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.14 - (show annotations) (download) (as text)
Fri Sep 16 04:12:58 2005 UTC (18 years, 6 months ago) by maloninc
Branch: MAIN
CVS Tags: dev_1_3-0006
Changes since 1.13: +6 -2 lines
File MIME type: text/x-chdr
implement group by TYPE, but it may be bugy? (9/16)

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

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