My favorites | Sign in
Project Home Issues Source
Checkout   Browse   Changes  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#ifndef AFX_SEARCH_H__201E0D70_9C20_420A_8600_966D2BA23010__INCLUDED_
#define AFX_SEARCH_H__201E0D70_9C20_420A_8600_966D2BA23010__INCLUDED_
#include "editwing/editwing.h"
#include "kilib/window.h"
#include "kilib/memory.h"
#include "kilib/ktlaptr.h"
#include "kilib/string.h"



//=========================================================================
//@{ @pkg Gp.Search //@}
//@{
// ŒŸõƒIƒuƒWƒFƒNƒg
//@}
//=========================================================================

class Searchable : public ki::Object
{
public:
//@{
// ŒŸõ‚ðs‚¤
// @param str ‘Ώە¶Žš—ñ
// @param len ‘Ώە¶Žš—ñ‚Ì’·‚³
// @param stt ŒŸõŠJŽnindexB0‚È‚çæ“ª‚©‚ç
// @param mbg ƒ}ƒbƒ`Œ‹‰Ê‚̐擪index
// @param med ƒ}ƒbƒ`Œ‹‰Ê‚̏I’[index‚Ì‚PŒÂŒã‚ë
// @return ƒ}ƒbƒ`‚µ‚½‚©‚Ç‚¤‚©
//
// ‰º•ûŒüƒT[ƒ`ƒIƒuƒWƒFƒNƒg‚̏ꍇAstt <= *beg ‚͈̔Í
// ã•ûŒüƒT[ƒ`ƒIƒuƒWƒFƒNƒg‚̏ꍇA*beg <= stt ‚Ì”ÍˆÍ‚ðŒŸõ
//@}
virtual bool Search( const unicode* str, ulong len, ulong stt,
ulong* mbg, ulong* med ) = 0;
};



//=========================================================================
//@{
// ŒŸõŠÇ—l
//
// ‘O‰ñŒŸõ‚µ‚½‚Æ‚«‚̃IƒvƒVƒ‡ƒ“‚⌟õ•¶Žš—ñ‚ðŠo‚¦‚Ä‚¨‚­‚Ì‚ª
// ‚±‚̃Nƒ‰ƒX‚Ì’S“–BŒŸõE’uŠ·ƒ_ƒCƒAƒƒO‚Ì•\Ž¦“™‚à‚±‚±‚Å
// ‚â‚é‚©‚à‚µ‚ê‚È‚¢B
//@}
//=========================================================================

class SearchManager : ki::DlgImpl
{
typedef editwing::DPos DPos;

public:
//@{ ƒRƒ“ƒXƒgƒ‰ƒNƒ^B“Á‹LŽ–€–³‚µ //@}
SearchManager( ki::Window& w, editwing::EwEdit& e );

//@{ ƒfƒXƒgƒ‰ƒNƒ^B“Á‹LŽ–€–³‚µ //@}
~SearchManager();

//@{ ŒŸõƒ_ƒCƒAƒƒO•\Ž¦ //@}
void ShowDlg();

//@{ [ŽŸ‚ðŒŸõ]ƒRƒ}ƒ“ƒh //@}
void FindNext();

//@{ [‘O‚ðŒŸõ]ƒRƒ}ƒ“ƒh //@}
void FindPrev();

//@{ ¡‚·‚®ŒŸõ‰Â”\‚©H //@}
bool isReady() const
{ return searcher_.isValid(); }

//@{ Ý’èSave //@}
void SaveToINI( ki::IniFile& ini );

//@{ Ý’èLoad //@}
void LoadFromINI( ki::IniFile& ini );

//@{ ‹ê“÷‚̍ô^^; //@}
bool TrapMsg(MSG* msg);

//@{ Œ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½ƒ_ƒCƒAƒƒO //@}
void NotFound();

private:

//@{ [’uŠ·]ƒRƒ}ƒ“ƒh //@}
void ReplaceImpl();

//@{ [‘S’uŠ·]ƒRƒ}ƒ“ƒh //@}
void ReplaceAllImpl();

private:

virtual void on_init();
virtual void on_destroy();
virtual bool on_command( UINT cmd, UINT id, HWND ctrl );
void on_findnext();
void on_findprev();
void on_replacenext();
void on_replaceall();
void UpdateData();
void ConstructSearcher( bool down=true );
void FindNextImpl();
void FindPrevImpl();
bool FindNextFromImpl( DPos s, DPos* beg, DPos* end );
bool FindPrevFromImpl( DPos s, DPos* beg, DPos* end );

private:
editwing::EwEdit& edit_;
ki::dptr<Searchable> searcher_;
ki::Window& mainWnd_;

bool bIgnoreCase_; // ‘啶Žš¬•¶Žš‚𓯈ꎋH
bool bRegExp_; // ³‹K•\Œ»H
bool bDownSearch_; // ŒŸõ•ûŒü
bool bChanged_; // ‘O‰ñ‚Ìsearcher\’zŽž‚©‚ç•ÏX‚ª‚ ‚Á‚½‚çtrue

ki::String findStr_;
ki::String replStr_;

private:
NOCOPY(SearchManager);
};



//=========================================================================

#endif // AFX_SEARCH_H__201E0D70_9C20_420A_8600_966D2BA23010__INCLUDED_

Change log

r89 by roytam on Apr 29, 2010   Diff
- [GreenPad] import GreenPad with NT 3.51
fix.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 3055 bytes, 130 lines

File properties

svn:eol-style
native
svn:mime-type
text/plain; charset=shift_jis
Powered by Google Project Hosting