Rename header files in .hpp
This commit is contained in:
146
src/controller/KissCount.hpp
Normal file
146
src/controller/KissCount.hpp
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
Copyright 2010-2011 Grégory Soutadé
|
||||
|
||||
This file is part of KissCount.
|
||||
|
||||
KissCount 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KissCount is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KISSCOUNT_H
|
||||
#define KISSCOUNT_H
|
||||
|
||||
#include <list>
|
||||
|
||||
#include <model/import/ImportEngine.hpp>
|
||||
#include <model/export/ExportEngine.hpp>
|
||||
#include <model/model.hpp>
|
||||
|
||||
#include <wx/display.h>
|
||||
|
||||
#include <view/wxUI.hpp>
|
||||
|
||||
#define APP_VERSION "0.3"
|
||||
|
||||
#define ESCAPE_CHARS(s) { \
|
||||
if (s.Find(wxT("\\\"")) == wxNOT_FOUND) \
|
||||
s.Replace(wxT("\""), wxT("\\\""), true); \
|
||||
if (s.Find(wxT("\\\'")) == wxNOT_FOUND) \
|
||||
s.Replace(wxT("\'"), wxT("\\\'"), true); \
|
||||
}
|
||||
|
||||
#define UNESCAPE_CHARS(s) { \
|
||||
s.Replace(wxT("\\\""), wxT("\""), true); \
|
||||
s.Replace(wxT("\\\'"), wxT("\'"), true); \
|
||||
}
|
||||
class wxUI;
|
||||
class Database;
|
||||
class ImportEngine;
|
||||
class ExportEngine;
|
||||
|
||||
class KissCount
|
||||
{
|
||||
public:
|
||||
KissCount(const char* bdd_filename);
|
||||
~KissCount();
|
||||
|
||||
std::list<wxString> GetUsers();
|
||||
bool IsValidUser(const wxString& user, const wxString& password);
|
||||
void LoadUser(const wxString& user);
|
||||
User* GetUser();
|
||||
void ChangePassword(const wxString& password);
|
||||
bool UserExists(const wxString& name);
|
||||
void ChangeName(const wxString& name);
|
||||
void NewUser(const wxString& name);
|
||||
|
||||
void LoadYear(int year, bool force=false);
|
||||
|
||||
wxString AddOperation(Operation& op, bool checkTransfert=true);
|
||||
void UpdateOperation(Operation& op, bool checkTransfert=true);
|
||||
void DeleteOperation(Operation& op);
|
||||
void DeleteOperations(int month, int year);
|
||||
double MetaAmount(const wxString& id);
|
||||
double MetaPositiveAmount(const wxString& id);
|
||||
|
||||
double GetAccountAmount(const wxString& id, int month, int year);
|
||||
void SetAccountAmount(const wxString& accountId, int month, int year, double value);
|
||||
double CalcAccountAmount(const wxString& id, int month, int year, bool* had_values);
|
||||
|
||||
wxString AddAccount(Account& ac);
|
||||
void UpdateAccount(Account& ac);
|
||||
void DeleteAccount(Account& ac, const wxString& replacement);
|
||||
void AddSharedAccount(Account& ac, const wxString& granted);
|
||||
void RemoveSharedAccount(Account& ac, const wxString& granted);
|
||||
std::map<wxString, wxString> getSharedAccountOwners(const wxString& account);
|
||||
wxString getSharedAccountOwner(const wxString& account);
|
||||
|
||||
wxString AddCategory(Category& category);
|
||||
void UpdateCategory(Category& category);
|
||||
void DeleteCategory(Category& category, const wxString& replacement);
|
||||
|
||||
std::map<int, std::vector<int> > GetAllOperations();
|
||||
|
||||
void GenerateMonth(int monthFrom, int yearFrom, int monthTo, int yearTo);
|
||||
void KillMe();
|
||||
|
||||
void SetLanguage(wxLanguage language);
|
||||
void SetOperationOrder(const wxString& order);
|
||||
const wxString& GetOperationOrder();
|
||||
|
||||
std::vector<Operation>* Search(wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
|
||||
wxString* amountFrom, wxString* amountTo,
|
||||
std::vector<wxString> categories, int types, std::vector<wxString> accounts);
|
||||
|
||||
bool SearchPreviousOperation(Operation* res, Operation& op, int month, int year, bool limitToType);
|
||||
|
||||
void GetStats(int monthFrom, int yearFrom, int monthTo, int yearTo,
|
||||
std::map<wxString, std::map<int, std::map<int, double> > >* accountAmounts,
|
||||
std::map<wxString, double>* categories);
|
||||
|
||||
void GetMonthStats(int month, int year, int nbDays,
|
||||
std::map<wxString, std::vector<double> >* operations,
|
||||
std::map<wxString, double>* categories);
|
||||
|
||||
std::map<wxString, double>* GetNotChecked(int month, int year);
|
||||
std::map<wxString, double>* GetVirtualAmount(int month, int year);
|
||||
|
||||
static wxFont ExtractFont(wxString strFont);
|
||||
static wxString CompactFont(const wxFont& font);
|
||||
|
||||
static void RegisterImportEngine(ImportEngine* engine);
|
||||
static void UnRegisterImportEngine(ImportEngine* engine);
|
||||
|
||||
wxString GetImportEngineExtensions();
|
||||
ImportEngine* GetImportEngine(wxString path);
|
||||
|
||||
static void RegisterExportEngine(ExportEngine* engine);
|
||||
static void UnRegisterExportEngine(ExportEngine* engine);
|
||||
|
||||
wxString GetExportEngineExtensions();
|
||||
ExportEngine* GetExportEngine(wxString path);
|
||||
|
||||
void UpdateImportPattern();
|
||||
|
||||
private:
|
||||
wxUI* _wxUI;
|
||||
Database* _db;
|
||||
User* _user;
|
||||
|
||||
static std::vector<ImportEngine*> *GetImportEngines();
|
||||
static std::vector<ExportEngine*> *GetExportEngines();
|
||||
|
||||
static std::vector<ImportEngine*> *_importEngines;
|
||||
static std::vector<ExportEngine*> *_exportEngines;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user