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
This commit is contained in:
gsherman 2005-04-24 05:05:04 +00:00
parent 2cfff3c90e
commit fb11503547
2 changed files with 91 additions and 0 deletions

39
src/qgsbookmarkitem.cpp Normal file
View File

@ -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 <iostream>
#include <sqlite3.h>
#include <qstring.h>
#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;
}

52
src/qgsbookmarkitem.h Normal file
View File

@ -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