From fb11503547f30018135b577916001cf52c781912 Mon Sep 17 00:00:00 2001 From: gsherman Date: Sun, 24 Apr 2005 05:05:04 +0000 Subject: [PATCH] Bookmark item class. A bookmark item is stored as a record in the users database git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@3211 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgsbookmarkitem.cpp | 39 +++++++++++++++++++++++++++++++ src/qgsbookmarkitem.h | 52 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/qgsbookmarkitem.cpp create mode 100644 src/qgsbookmarkitem.h diff --git a/src/qgsbookmarkitem.cpp b/src/qgsbookmarkitem.cpp new file mode 100644 index 00000000000..37ec1aefa62 --- /dev/null +++ b/src/qgsbookmarkitem.cpp @@ -0,0 +1,39 @@ + +/*************************************************************************** + QgsBookmarkItem.h - Spatial Bookmark Item + ------------------- + begin : 2005-04-23 + copyright : (C) 2005 Gary Sherman + email : sherman at mrcc dot com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + /* $Id$ */ +#include +#include +#include + +#include "qgsrect.h" +#include "qgsbookmarkitem.h" + +QgsBookmarkItem::QgsBookmarkItem(QString name, QString projectTitle, + QgsRect viewExtent, int srid, QString dbPath) + : mName(name), mProjectTitle(projectTitle), mViewExtent(viewExtent), + mSrid(srid), mDbPath(dbPath) +{ +} +QgsBookmarkItem::~QgsBookmarkItem() +{ +} + void QgsBookmarkItem::store() +{ + std::cout << "Storing bookmark" << std::endl; +} + diff --git a/src/qgsbookmarkitem.h b/src/qgsbookmarkitem.h new file mode 100644 index 00000000000..d22ed5eab14 --- /dev/null +++ b/src/qgsbookmarkitem.h @@ -0,0 +1,52 @@ + +/*************************************************************************** + QgsBookmarkItem.h - Spatial Bookmark Item + ------------------- + begin : 2005-04-23 + copyright : (C) 2005 Gary Sherman + email : sherman at mrcc dot com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + /* $Id$ */ +#ifndef QGSBOOKMARKITEM_H +#define QGSBOOKMARKITEM_H +class QString; +class QgsRect; +/*! + * \class QgsBookmarkItem + * \brief A spatial bookmark record that is stored in a sqlite3 + * database. + */ +class QgsBookmarkItem +{ +public: + //! Constructs a bookmark item + QgsBookmarkItem(QString name, QString projectTitle, + QgsRect viewExtent, int srid, QString databasePath); + //! Default destructor + ~QgsBookmarkItem(); + //! Store the bookmark in the database + void store(); +private: + //! Name of the bookmark + QString mName; + //! Project that this bookmark was created from + QString mProjectTitle; + //! Extent of the view for the bookmark + QgsRect mViewExtent; + //! SRID of the canvas coordinate system when the bookmark was created + int mSrid; + //! Full path to the user database + QString mDbPath; + +}; + +#endif // QGSBOOKMARKITEM_H