Develop and Download Open Source Software

Browse CVS Repository

Contents of /malonnote/mnModel.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.22 - (show annotations) (download) (as text)
Mon Oct 23 08:00:09 2006 UTC (17 years, 4 months ago) by maloninc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.21: +1 -1 lines
File MIME type: text/x-chdr
readAll with wxTimer

1 #ifndef MNMODEL_H
2 #define MNMODEL_H
3
4 #include <wx/wx.h>
5 #include <wx/treebase.h>
6
7 #include "config.h"
8
9 #define MAX_WIKI_TEXT_SIZE (1048576*5)
10 #define MAX_TOKEN 32
11 #define MAX_BUF_SIZE 1024
12 #define EXT_TAG ".txt"
13 #define DATE_TAG ":''DATE'':"
14 #define TYPE_TAG ":''TYPE'':"
15 #define NEW_DATA DATE_TAG " %Y/%m/%d %H:%M:%S\n\n" TYPE_TAG " memo\n---------------------------------------------------------\n"
16 #define NEW_DATA_TEMPLATE "new.template"
17
18 #define ALLMEMO_TAG "malon-all"
19 #define TYPESEARCH_TAG "malon-type:"
20
21 #define CODE_SET_EUC_JP "eucJP"
22 #ifdef __WXMAC__
23 #define CODE_SET_SYSTEM "CP932"
24 #endif
25 #ifdef __WXCOCOA__
26 #define CODE_SET_SYSTEM "CP932"
27 #endif
28 #ifdef __WXMSW__
29 #define CODE_SET_SYSTEM "CP932"
30 #endif
31 #ifdef __WXMOTIF__
32 #define CODE_SET_SYSTEM "eucJP"
33 #endif
34 #ifdef __WXGTK__
35 #define CODE_SET_SYSTEM "euc-jp"
36 #endif
37 #ifdef __WXX11__
38 #define CODE_SET_SYSTEM "eucJP"
39 #endif
40
41 #define MAC_BACKSLASH 0x80
42
43
44 class WikiData : wxTreeItemData{
45
46 public:
47 WikiData(wxString* dataDir, wxString* fileName);
48 WikiData(wxString* dataDir);
49 ~WikiData();
50 const wxString* getFileName();
51 const wxString* getSubject();
52 const wxString* getOldSubject();
53 const wxString* getDate();
54 const wxString* getText();
55 void modText(wxString* text);
56 void modSubject(wxString* newName);
57 void save();
58 void removeDataFile();
59 void setOldSubjectFromCurrent();
60
61 private:
62 wxString* subject;
63 wxString* oldSubject;
64 wxString* dataDirName;
65 wxString* fileName;
66 wxString* date;
67 wxString* text;
68 bool isWriteToFile;
69 };
70
71 /* Search Result List */
72 WX_DECLARE_LIST(WikiData, WikiList);
73
74 /* Search Result Hash (Key is search string) */
75 WX_DECLARE_STRING_HASH_MAP(WikiList*, WikiHash);
76
77
78 class mnModel {
79
80 public:
81 mnModel(const char* dataDir);
82 ~mnModel();
83 bool makeSearchToken(const char* searchStr, char* tokenList[]);
84 bool matchWithToken(wxString* fileName, char* tokenList[]);
85 WikiList* search(const char* searchStr);
86 void readAll(bool progBarFlag);
87 void group();
88 bool normalSearch(char* tokenList[], FILE*fp, char* decodeFileNameBuf);
89 bool typeSearch(char* typeStr, FILE*fp);
90 void addWikiData(WikiData* wikiData);
91 bool addSearchStr(wxString* searchStr);
92 void addSearchList(wxString* searchStr, WikiList* list);
93 void removeSearchStr(wxString searchStr);
94 void modSearchStr(wxString* oldStr, wxString* newStr);
95 const wxArrayString* getSearchStrList();
96 const WikiList* getSearchResultList(wxString* searchStr);
97 void addSearchResultList(wxString* searchStr, WikiData* addData);
98 bool delSearchResultList(wxString* searchStr, WikiData* delData);
99 WikiData* newWikiData();
100 const wxString* getWikiDataDir();
101 void clearSearchStrList();
102 void clearSearchResultList();
103 private:
104 wxString* wikiDataDir;
105 wxArrayString* searchStrList;
106 WikiHash wikiHash;
107 };
108
109
110 #endif //MNMODEL_H

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26