| 1 |
maloninc |
1.1 |
#ifndef MNMODEL_H |
| 2 |
|
|
#define MNMODEL_H |
| 3 |
|
|
|
| 4 |
|
|
#include <wx/wx.h> |
| 5 |
|
|
#include <wx/treebase.h> |
| 6 |
|
|
|
| 7 |
|
|
#define MAX_WIKI_TEXT_SIZE 10000 |
| 8 |
|
|
#define MAX_BUF_SIZE 1024 |
| 9 |
|
|
#define EXT_TAG ".txt" |
| 10 |
|
|
#define DATE_TAG ":''DATE'':" |
| 11 |
|
|
#define NEW_DATA DATE_TAG " %Y/%m/%d %H:%M:%S\n\n:''TYPE'': memo\n----\n" |
| 12 |
|
|
|
| 13 |
|
|
#define CODE_SET_EUC_JP "eucJP" |
| 14 |
|
|
#ifdef __WXMAC__ |
| 15 |
|
|
#define CODE_SET_SYSTEM "SJIS" |
| 16 |
|
|
#endif |
| 17 |
maloninc |
1.2 |
#ifdef __WXCOCOA__ |
| 18 |
|
|
#define CODE_SET_SYSTEM "SJIS" |
| 19 |
|
|
#endif |
| 20 |
maloninc |
1.1 |
#ifdef __WXMSW__ |
| 21 |
|
|
#define CODE_SET_SYSTEM "SJIS" |
| 22 |
|
|
#endif |
| 23 |
|
|
#ifdef __WXMOTIF__ |
| 24 |
|
|
#define CODE_SET_SYSTEM "eucJP" |
| 25 |
|
|
#endif |
| 26 |
|
|
#ifdef __WXGTK__ |
| 27 |
|
|
#define CODE_SET_SYSTEM "eucJP" |
| 28 |
|
|
#endif |
| 29 |
|
|
#ifdef __WXX11__ |
| 30 |
|
|
#define CODE_SET_SYSTEM "eucJP" |
| 31 |
|
|
#endif |
| 32 |
|
|
|
| 33 |
|
|
|
| 34 |
|
|
|
| 35 |
|
|
|
| 36 |
|
|
class WikiData : wxTreeItemData{ |
| 37 |
|
|
|
| 38 |
|
|
public: |
| 39 |
|
|
WikiData(wxString* dataDir, const char* fileName, FILE* fp); |
| 40 |
|
|
WikiData(wxString* dataDir); |
| 41 |
|
|
~WikiData(); |
| 42 |
|
|
const wxString* getFileName(); |
| 43 |
|
|
const wxString* getSubject(); |
| 44 |
|
|
const wxString* getDate(); |
| 45 |
|
|
const wxString* getText(); |
| 46 |
|
|
void modText(wxString* text); |
| 47 |
|
|
void modSubject(wxString* newName); |
| 48 |
|
|
void save(); |
| 49 |
|
|
void removeDataFile(); |
| 50 |
|
|
|
| 51 |
|
|
private: |
| 52 |
|
|
wxString* subject; |
| 53 |
|
|
wxString* dataDirName; |
| 54 |
|
|
wxString* fileName; |
| 55 |
|
|
wxString* date; |
| 56 |
|
|
wxString* text; |
| 57 |
|
|
}; |
| 58 |
|
|
|
| 59 |
|
|
WX_DECLARE_LIST(WikiData, WikiList); |
| 60 |
|
|
|
| 61 |
|
|
|
| 62 |
|
|
|
| 63 |
|
|
class mnModel { |
| 64 |
|
|
|
| 65 |
|
|
public: |
| 66 |
|
|
mnModel(const char* dataDir); |
| 67 |
|
|
~mnModel(); |
| 68 |
|
|
WikiList* search(const char* searchStr); |
| 69 |
|
|
void addWikiData(WikiData* wikiData); |
| 70 |
|
|
void addSearchStr(wxString* searchStr); |
| 71 |
|
|
void removeSearchStr(wxString searchStr); |
| 72 |
|
|
void modSearchStr(wxString* oldStr, wxString* newStr); |
| 73 |
|
|
const wxArrayString* getSearchStrList(); |
| 74 |
|
|
WikiData* newWikiData(); |
| 75 |
|
|
|
| 76 |
|
|
private: |
| 77 |
|
|
wxString* wikiDataDir; |
| 78 |
|
|
wxArrayString* searchStrList; |
| 79 |
|
|
}; |
| 80 |
|
|
|
| 81 |
|
|
|
| 82 |
|
|
#endif //MNMODEL_H |