| 1 |
////////////////////////////////////////////////////////////////////////////// |
| 2 |
////////////////////////////////////////////////////////////////////////////// |
| 3 |
// |
| 4 |
// copyright : (C) 2014 Eran Ifrah |
| 5 |
// file name : database.h |
| 6 |
// |
| 7 |
// ------------------------------------------------------------------------- |
| 8 |
// A |
| 9 |
// _____ _ _ _ _ |
| 10 |
// / __ \ | | | | (_) | |
| 11 |
// | / \/ ___ __| | ___| | _| |_ ___ |
| 12 |
// | | / _ \ / _ |/ _ \ | | | __/ _ ) |
| 13 |
// | \__/\ (_) | (_| | __/ |___| | || __/ |
| 14 |
// \____/\___/ \__,_|\___\_____/_|\__\___| |
| 15 |
// |
| 16 |
// F i l e |
| 17 |
// |
| 18 |
// This program is free software; you can redistribute it and/or modify |
| 19 |
// it under the terms of the GNU General Public License as published by |
| 20 |
// the Free Software Foundation; either version 2 of the License, or |
| 21 |
// (at your option) any later version. |
| 22 |
// |
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
////////////////////////////////////////////////////////////////////////////// |
| 25 |
|
| 26 |
#ifndef DATABASE_H |
| 27 |
#define DATABASE_H |
| 28 |
#include <wx/wx.h> |
| 29 |
#include <wx/dblayer/include/DatabaseResultSet.h> |
| 30 |
#include <wx/wxxmlserializer/XmlSerializer.h> |
| 31 |
|
| 32 |
|
| 33 |
// ------------------------------------------------- |
| 34 |
// Trida databaze |
| 35 |
// ------------------------------------------------- |
| 36 |
class IDbAdapter; |
| 37 |
/*! \brief Class representing one database */ |
| 38 |
class Database : public xsSerializable { |
| 39 |
|
| 40 |
|
| 41 |
protected: |
| 42 |
wxString m_name; |
| 43 |
IDbAdapter* m_pDbAdapter; |
| 44 |
|
| 45 |
public: |
| 46 |
XS_DECLARE_CLONABLE_CLASS(Database); |
| 47 |
/*! \brief Default consturctors */ |
| 48 |
Database(); |
| 49 |
Database(const Database& obj); |
| 50 |
Database(IDbAdapter* dbAdapter,const wxString& dbName); |
| 51 |
/*! \brief Default destructor*/ |
| 52 |
virtual ~Database(); |
| 53 |
/*! \brief Refresh all children, if includeViews is true, all view will be load as tables.*/ |
| 54 |
void RefreshChildren(bool includeViews); |
| 55 |
/*! \brief Refresh all children details (table columns atc.) */ |
| 56 |
void RefreshChildrenDetails(); |
| 57 |
/*! \brief Return IDbAdapter */ |
| 58 |
IDbAdapter* GetDbAdapter() { return this->m_pDbAdapter; } |
| 59 |
/*! \brief Return database name*/ |
| 60 |
wxString GetName() { return this->m_name; } |
| 61 |
|
| 62 |
|
| 63 |
}; |
| 64 |
|
| 65 |
#endif // DATABASE_H |