OSDN Git Service

BrowserTabとスレ一覧のフォントのスタイル指定をできるようにした。
[gikonavigoeson/gikonavi.git] / Setting.pas
1 unit Setting;
2
3 interface
4
5 uses
6         SysUtils, Classes, Graphics, Forms, Math, IniFiles, UCryptAuto, UBase64,
7         ComCtrls, GestureModel;
8
9 const
10         MAIN_COOLBAND_COUNT = 4;                //\83\81\83C\83\93CoolBand\82Ì\90\94
11         LIST_COOLBAND_COUNT = 2;                //\94ÂCoolBand\82Ì\90\94
12         BROWSER_COOLBAND_COUNT = 3;     //\83u\83\89\83E\83UCoolBand\82Ì\90\94
13
14         BOARD_FILE_NAME                                                         = 'board.2ch';
15         CUSTOMBOARD_FILE_NAME                                   = 'custom.2ch';
16         BOARD_DIR_NAME                                                          = 'Board';
17         KEY_SETTING_FILE_NAME                                   = 'key.ini';
18         EKEY_SETTING_FILE_NAME                          = 'Ekey.ini';
19         TEMP_FOLDER                                                                             = 'Temp';
20         OUTBOX_FILE_NAME                                                        = 'outbox.ini';
21         SENT_FILE_NAME                                                          = 'sent.ini';
22         CONFIG_DIR_NAME                                                         = 'config';
23         CSS_DIR_NAME                                                                    = 'css';
24         SKIN_DIR_NAME                                                                   = 'skin';
25         SKIN_HEADER_FILE_NAME                                   = 'Header.html';
26         SKIN_FOOTER_FILE_NAME                                   = 'Footer.html';
27         SKIN_NEWRES_FILE_NAME                                   = 'NewRes.html';
28         SKIN_RES_FILE_NAME                                              = 'Res.html';
29         SKIN_BOOKMARK_FILE_NAME                         = 'Bookmark.html';
30         SKIN_NEWMARK_FILE_NAME                          = 'Newmark.html';
31         NGWORDs_DIR_NAME : String               = 'NGwords';
32         BOARD_PLUGIN_DIR_NAME                                   = 'BoardPlugin';
33         SAMBATIME_FILE_NAME : String    = 'Samba.ini';
34         IGNORE_FILE_NAME : String               = 'Ignore.txt';
35 //      DOLIB_LOGIN_URL     = '/~tora3n2c/futen.cgi';
36         MAX_POPUP_RES : Integer = 10;
37         GESTURE_FILE_NAME                                                       = 'Gestures.ini';
38         SPAMFILTER_FILE_NAME                                    = 'SpamFilter.ini';
39 type
40         TGikoTabPosition = (gtpTop, gtpBottom);                                                         // \83^\83u\88Ê\92u
41         TGikoTabAppend = (gtaFirst, gtpLast);                                                                   // \83^\83u\92Ç\89Á\88Ê\92u
42         TGikoTabStyle = (gtsTab, gtsButton, gtsFlat);                                   // \83^\83u\83X\83^\83C\83\8b
43         TGikoListOrientation = (gloHorizontal, gloVertical);    // \83\8a\83X\83g\90\82\92¼\81E\90\85\95½
44         TGikoListState = (glsMax, glsNormal, glsMin);                                   // \83\8a\83X\83g\83T\83C\83Y\8fó\91Ô
45                                                                                                                                                                                                                                 // \83|\83b\83v\83A\83b\83v\95\\8e¦\88Ê\92u
46         TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
47                                                                                                 gppRight, gppCenter, gppLeft,
48                                                                                                 gppRightBottom, gppBottom, gppLeftBottom);
49                                                                                                                                                                                                                                 //\83v\83\8c\83r\83\85\81[\83T\83C\83Y
50         TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
51         TGikoBrowserAutoMaximize        = (gbmNone, gbmClick, gbmDoubleClick);
52                                                                                                                                                                                                                                 // \83u\83\89\83E\83U\82ð\8e©\93®\93I\82É\8dÅ\91å\89»\82·\82é\8fð\8c\8f
53         /// \83\8c\83X\95\\8e¦\94Í\88Í\81B10 \81` 65535 \82Í\8dÅ\90V n \83\8c\83X\88µ\82¢\81B
54         /// \8f«\97\88 201-300 \82Ì\82æ\82¤\82È\94Í\88Í\82ð\8e\9d\82½\82¹\82é\89Â\94\\90«\82à\8dl\82¦\82Ä\8fã\88Ê 2 byte \82Í\97\\96ñ\81B
55         TGikoResRange = (grrAll, grrSelect, grrKoko, grrNew);
56
57         /// \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
58         TGikoThreadRange = (gtrAll, gtrSelect, gtrLog, gtrNew);
59
60         /// \83J\83e\83S\83\8a\83\8a\83X\83g\82Ì\83J\83\89\83\80 ID
61         type    TGikoBBSColumnID = (gbbscTitle);
62         /// \83J\83e\83S\83\8a\83\8a\83X\83g\82Ì\83J\83\89\83\80\96¼
63         const   GikoBBSColumnCaption : array[0..0] of string =
64                 ( '\83J\83e\83S\83\8a\96¼' );
65         /// \83J\83e\83S\83\8a\83\8a\83X\83g\83J\83\89\83\80\94z\97ñ
66         type    TGikoBBSColumnList = class( TList )
67         private
68                 function GetItem( index : integer ) : TGikoBBSColumnID;
69                 procedure SetItem( index : integer; value : TGikoBBSColumnID);
70         public
71                 constructor Create;
72                 destructor Destroy;     override;
73                 function Add( value : TGikoBBSColumnID ) : Integer;
74                 property Items[index : integer]: TGikoBBSColumnID read GetItem write SetItem; default;
75         end;
76         /// \94Â\83\8a\83X\83g\82Ì\83J\83\89\83\80 ID
77         type    TGikoCategoryColumnID = (gccTitle, gccRoundName, gccLastModified);
78         /// \94Â\83\8a\83X\83g\82Ì\83J\83\89\83\80\96¼
79         const GikoCategoryColumnCaption : array[0..2] of string =
80                 ( '\94Â\96¼', '\8f\84\89ñ\97\\96ñ', '\8eæ\93¾\93ú\8e\9e' );
81         /// \94Â\83\8a\83X\83g\83J\83\89\83\80\94z\97ñ
82         type    TGikoCategoryColumnList = class( TList )
83         private
84                 function GetItem( index : integer ) : TGikoCategoryColumnID;
85                 procedure SetItem( index : integer; value : TGikoCategoryColumnID);
86         public
87                 constructor Create;
88                 destructor Destroy;     override;
89                 function Add( value : TGikoCategoryColumnID ) : Integer;
90                 property Items[index : integer]: TGikoCategoryColumnID read GetItem write SetItem; default;
91         end;
92         /// \83X\83\8c\83\8a\83X\83g\82Ì\83J\83\89\83\80 ID
93         type    TGikoBoardColumnID = (gbcTitle, gbcAllCount, gbcLocalCount, gbcNonAcqCount,
94                 gbcNewCount, gbcUnReadCount, gbcRoundName, gbcRoundDate, gbcCreated, gbcLastModified );{gbcLastModified,}
95         /// \83X\83\8c\83\8a\83X\83g\82Ì\83J\83\89\83\80\96¼
96         const   GikoBoardColumnCaption : array[0..9] of string =
97                 ( '\83X\83\8c\83b\83h\96¼', '\83J\83E\83\93\83g', '\8eæ\93¾', '\96¢\8eæ\93¾', '\90V\92\85',
98                 '\96¢\93Ç', '\8f\84\89ñ\97\\96ñ', '\8eæ\93¾\93ú\8e\9e', '\83X\83\8c\8dì\90¬\93ú\8e\9e', '\8dÅ\8fI\8dX\90V\93ú\8e\9e' );
99         const GikoBoardColumnAlignment : array[0..9] of TAlignment = (
100                 taLeftJustify, taRightJustify, taRightJustify, taRightJustify,
101                 taRightJustify, taRightJustify, taLeftJustify, taLeftJustify,
102                 taLeftJustify, taLeftJustify);
103         /// \83X\83\8c\83\8a\83X\83g\83J\83\89\83\80\94z\97ñ
104         type    TGikoBoardColumnList = class( TList )
105         private
106                 function GetItem( index : integer ) : TGikoBoardColumnID;
107                 procedure SetItem( index : integer; value : TGikoBoardColumnID);
108         public
109                 constructor Create;
110                 destructor Destroy;     override;
111                 function Add( value : TGikoBoardColumnID ) : Integer;
112                 property Items[index : integer]: TGikoBoardColumnID read GetItem write SetItem; default;
113         end;
114
115 type
116         //CoolBar\90Ý\92è\83\8c\83R\81[\83h
117         TCoolSet = record
118                 FCoolID: Integer;
119                 FCoolWidth: Integer;
120                 FCoolBreak: Boolean;
121         end;
122
123         TSetting = class(TObject)
124         private
125                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
126                 FRecvBufferSize: Integer;
127                 //HTTP1.1\8eg\97p
128                 FProtocol: Boolean;
129                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
130                 FProxyProtocol: Boolean;
131
132                 //\83v\83\8d\83L\83V\81i\93Ç\8d\9e\97p\81j
133                 FReadProxy: Boolean;
134                 FReadProxyAddress: string;
135                 FReadProxyPort: Integer;
136                 FReadProxyUserID: string;
137                 FReadProxyPassword: string;
138
139                 //\83v\83\8d\83L\83V\81i\8f\91\8d\9e\97p\81j
140                 FWriteProxy: Boolean;
141                 FWriteProxyAddress: string;
142                 FWriteProxyPort: Integer;
143                 FWriteProxyUserID: string;
144                 FWriteProxyPassword: string;
145
146                 //\83L\83\83\83r\83l\83b\83g
147                 FCabinetFontName: string;
148                 FCabinetFontSize: Integer;
149                 FCabinetFontBold: Boolean;
150                 FCabinetFontItalic: Boolean;
151                 FCabinetFontColor: TColor;
152                 FCabinetBackColor: TColor;
153
154                 //\83\8a\83X\83g
155                 FListFontName: string;
156                 FListFontSize: Integer;
157                 FListFontBold: Boolean;
158                 FListFontItalic: Boolean;
159                 FListFontColor: TColor;
160                 FListBackColor: TColor;
161
162                 //\83u\83\89\83E\83U
163                 FBrowserFontName: string;                       // ''...default
164                 FBrowserFontSize: Integer;              // 0...default
165                 FBrowserFontBold: Integer;              // 0...default, -1...False, 1...True
166                 FBrowserFontItalic: Integer;    // \8fã\82É\93¯\82
167                 FBrowserFontColor: Integer;             // -1...default
168                 FBrowserBackColor: Integer;             // \8fã\82É\93¯\82
169
170                 //\83G\83f\83B\83^
171                 FEditorFontName: string;
172                 FEditorFontSize: Integer;
173                 FEditorFontBold: Boolean;
174                 FEditorFontItalic: Boolean;
175                 FEditorFontColor: TColor;
176                 FEditorBackColor: TColor;
177
178                 //\83^\83u\83t\83H\83\93\83g
179                 FBrowserTabFontName: string;
180                 FBrowserTabFontSize: Integer;
181                 FBrowserTabFontBold: Boolean;
182                 FBrowserTabFontItalic: Boolean;
183
184                 //\83q\83\93\83g\83E\83B\83\93\83h\83E
185                 FHintFontName: string;
186                 FHintFontSize: Integer;
187                 //FHintFontBold: Boolean;
188                 //FHintFontItalic: Boolean;
189                 FHintFontColor: TColor;
190                 FHintBackColor: TColor;
191
192                 //\83E\83B\83\93\83h\83E\83T\83C\83Y
193                 FWindowTop: Integer;
194                 FWindowLeft: Integer;
195                 FWindowHeight: Integer;
196                 FWindowWidth: Integer;
197                 FWindowMax: Boolean;
198                 //\83\8a\83X\83g\83r\83\85\81[\83X\83^\83C\83\8b
199                 FListStyle: TViewStyle;
200
201                 //\83c\81[\83\8b\83o\81[\95\\8e¦
202                 FStdToolBarVisible: Boolean;
203                 FAddressBarVisible: Boolean;
204                 FLinkBarVisible: Boolean;
205                 FListToolBarVisible: Boolean;
206                 FListNameBarVisible: Boolean;
207                 FBrowserToolBarVisible: Boolean;
208                 FBrowserNameBarVisible: Boolean;
209
210                 //\83u\83\89\83E\83U\83^\83u
211                 FBrowserTabVisible: Boolean;
212                 FBrowserTabPosition: TGikoTabPosition;
213                 FBrowserTabAppend: TGikoTabAppend;
214                 FBrowserTabStyle: TGikoTabStyle;
215
216                 //\83\81\83b\83Z\81[\83W\83o\81[
217                 FMessageBarVisible: Boolean;
218                 FMessegeBarHeight: Integer;
219
220                 //\83X\83e\81[\83^\83X\83o\81[
221                 FStatusBarVisible: Boolean;
222
223                 //\83L\83\83\83r\83l\83b\83g\89Â\8e\8b\81E\83T\83C\83Y
224                 FCabinetVisible: Boolean;
225                 FCabinetWidth: Integer;
226
227                 //\83\8a\83X\83g\81E\83u\83\89\83E\83U\83T\83C\83Y
228                 FListOrientation: TGikoListOrientation;
229                 FListHeight: Integer;
230                 FListHeightState: TGikoListState;
231                 FListWidth: Integer;
232                 FListWidthState: TGikoListState;
233 //              FListHeightMax: Boolean;
234 //              FListWidthMax: Boolean;
235
236                 //\91\97\90M\97p\96¼\91O\81E\83\81\81[\83\8b
237                 FNameList: TStringList;
238                 FMailList: TStringList;
239
240                 //\83G\83f\83B\83^\81[\83E\83B\83\93\83h\83E\83T\83C\83Y
241                 FEditWindowTop: Integer;
242                 FEditWindowLeft: Integer;
243                 FEditWindowHeight: Integer;
244                 FEditWindowWidth: Integer;
245                 FEditWindowMax: Boolean;
246         FEditWindowStay: Boolean;
247         FEditWindowTranslucent: Boolean;
248
249                 //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦
250                 FListViewNo: Boolean;
251                 //CSS\95\\8e¦
252                 FUseCSS: Boolean;
253                 //CSS\83t\83@\83C\83\8b\96¼
254                 FCSSFileName: string;
255                 // \83X\83L\83\93\95\\8e¦(\88ê\8e\9e\93I\82È\82à\82Ì\82Å ini \82É\95Û\91\82Í\82³\82ê\82È\82¢)
256                 FUseSkin: Boolean;
257                 //mail\97\93\95\\8e¦
258                 FShowMail: Boolean;
259                 /// \83\8c\83X\95\\8e¦\94Í\88Í
260                 FResRange                       : Longint;
261                 /// \8bN\93®\8e\9e\83\8c\83X\95\\8e¦\94Í\88Í\82Ì\8cÅ\92è
262                 FResRangeHold   : Boolean;
263                 /// \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
264                 FThreadRange    : TGikoThreadRange;
265                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
266                 FUnActivePopup: Boolean;
267                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
268                 FResPopupHeaderBold: Boolean;
269
270                 //\83\8d\83O\83t\83H\83\8b\83_
271                 FLogFolder: string;
272                 FNewLogFolder: string;
273
274                 //\83\8a\83X\83g\83J\83\89\83\80\83w\83b\83_\81[\83T\83C\83Y
275                 FBBSColumnWidth: array[0..0] of Integer;
276                 FCategoryColumnWidth: array[0..2] of Integer;
277                 FBoardColumnWidth: array[0..9] of Integer;
278
279                 /// \83J\83e\83S\83\8a\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
280                 FBBSColumnOrder : TGikoBBSColumnList;
281                 /// \94Â\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
282                 FCategoryColumnOrder : TGikoCategoryColumnList;
283                 /// \83X\83\8c\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
284                 FBoardColumnOrder : TGikoBoardColumnList;
285
286                 //\83\\81[\83g\8f\87
287                 FBBSSortIndex: Integer;
288                 FBBSSortOrder: Boolean;
289                 FCategorySortIndex: Integer;
290                 FCategorySortOrder: Boolean;
291                 FBoardSortIndex: Integer;
292                 FBoardSortOrder: Boolean;
293
294                 //Dat\97\8e\82¿\83X\83\8c\83\\81[\83g\8f\87
295                 FDatOchiSortIndex: Integer;
296                 FDatOchiSortOrder: Boolean;
297
298                 //\8di\8d\9e\82Ý\95\8e\9a\97ñ
299                 FSelectTextList: TStringList;
300
301                 //\94Â\88ê\97\97URL
302                 //FBoardURL2ch: string;
303                 FBoardURLs: TStringList;
304                 FBoardURLSelected: Integer;
305
306                 //\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
307                 FUserID: string;
308                 FPassword: string;
309                 FAutoLogin: Boolean;
310         FForcedLogin: Boolean;
311                 FDolibURL: string;
312
313                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
314                 FURLApp: Boolean;
315                 FURLAppFile: string;
316
317                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
318                 FOpenMailer: Boolean;
319
320                 //\8dí\8f\9c\8am\94F
321                 FDeleteMsg: Boolean;
322
323                 //CoolBar\81i\83\81\83C\83\93\81E\94Â\81E\83u\83\89\83E\83U\81j
324                 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
325                 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
326                 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
327
328                 //ToolBar Wrapable
329                 FListToolBarWrapable: Boolean;
330                 FBrowserToolBarWrapable: Boolean;
331
332                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
333                 FPopupPosition: TGikoPopupPosition;
334
335                 //\83A\83h\83\8c\83X\83o\81[
336                 FURLDisplay: Boolean;
337                 FAddressBarTabStop: Boolean;
338                 FLinkAddAddressBar: Boolean;
339                 FAddressHistoryCount: Integer;
340
341                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
342                 FPreviewVisible: Boolean;
343                 FPreviewSize: TGikoPreviewSize;
344                 FPreviewWait: Integer;
345
346                 // \83u\83\89\83E\83U
347                 FBrowserAutoMaximize: TGikoBrowserAutoMaximize;
348
349                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93\95\\8e¦
350                 FListIconVisible: Boolean;
351
352                                 //\83X\83\8c\83b\83h\88ê\97\97\82ÅLog\82Ì\82 \82é\83X\83\8c\83b\83h\82Ì\82Ý\83X\83\8c\8dì\90¬\93ú\82ð\95\\8e¦\82·\82é\82©
353                                 FCreationTimeLogs: Boolean;
354         //\83X\83\8c\83b\83h\88ê\97\97\82Ì\83X\83\8c\90\90¬\93ú\82Å\96¢\97\88\82Ì\83X\83\8c\82Ì\90\90¬\93ú\82ð\95\\8e¦\82µ\82È\82¢
355                 FFutureThread: Boolean;
356
357                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8aÔ\8eg\97p\90Ý\92è
358                 FUseMachineTime: Boolean;
359                 FTimeAdjustSec: Integer;
360                 FTimeAdjust: Boolean;
361
362                 //\82 \82Ú\81`\82ñ
363                 FAbonDeleterlo : Boolean; //&rlo;\82ð\8dí\82é\82©
364                 FAbonReplaceul : Boolean; //<ul>\83^\83O\82ð<br>\83^\83O\82É\92u\8a·\82·\82é\82©
365                 FPopUpAbon               : Boolean; //\83\8c\83X\83|\83b\83v\83A\83b\83v\8e\9e\82Ì\82 \82Ú\81`\82ñ\97L\8cø
366                 FShowNGLinesNum : Boolean; //\8aY\93\96\82µ\82½\82m\82f\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\8ds\90\94\82ð\95\\8e¦
367                 FAddResAnchor : Boolean; //NG\83\8c\83X\82Ö\82Ì\83\8c\83X\83A\83\93\83J\81[\82ð\92Ç\89Á\82·\82é
368         FDeleteSyria : Boolean; //\83V\83\8a\83A\8cê\83u\83\89\83N\83\89\91Î\8dô
369
370                 // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
371                 FSelectComboBoxWidth : Integer;
372
373                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83I\83v\83V\83\87\83\93\83_\83C\83A\83\8d\83O\82Ì\83^\83u
374                 FOptionDialogTabIndex: Integer;
375
376                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g
377                 FCabinetIndex: Integer;
378
379                 //\8fI\97¹\8e\9e\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é\82©
380                 FShowDialogForEnd : Boolean;
381                 //\91S\82Ä\82Ì\83^\83u\95Â\82\82é\82Ì\82Æ\82«\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é
382                 FShowDialogForAllTabClose: Boolean;
383                 //\8eæ\93¾\83\8c\83X\90\94\82Æ\83X\83\8c\83b\83h\82Ì\83\8c\83X\90\94\82ª\88Ù\82È\82Á\82½\82Æ\82«\82É\92Ê\8fí\94w\8ci\90F\82Æ\88á\82Á\82½\90F\82Ì\94w\8ci\90F\82ð\8eg\97p\82·\82é\82©
384                 FUseOddColorOddResNum: Boolean;
385                 FOddColor: TColor;
386
387         //Samba24\91Î\8dô\8b@\94\\82ð\8eg\82¤\82©
388         FUseSamba: Boolean;
389
390                 //\83\8c\83X\83A\83\93\83J\81[\82ð\83N\83\8a\83b\83N\82µ\82Ä\83W\83\83\83\93\83v\82·\82é\82©
391                 FResAnchorJamp: Boolean;
392
393                 //Tab\8e©\93®\95Û\91
394                 FTabAutoLoadSave : Boolean;
395
396                 //\82É\82¿\82á\82ñ\8cê\88Ä\93à\83T\83|\81[\83g\8b@\94\
397                 F2chSupport : Boolean;
398
399                 // \83G\83f\83B\83^
400                 FSpaceToNBSP    : Boolean;      ///< \94¼\8ap\83X\83y\81[\83X\81ATab \82ð &nbsp; \82É\92u\8a·
401                 FAmpToCharRef   : Boolean;      ///< '&' \82ð &amp; \82É\92u\8a·
402
403                 //\83u\83\89\83E\83U\83^\83u\94ñ\95\\8e¦\82Ì\8e\9e\82Ì\83X\83\8c\88ê\97\97\82Å\82Ì\83J\81[\83\\83\8b\83L\81[\88Ú\93®\82Ì\96³\94½\89\9e\8e\9e\8aÔ
404                 FSelectInterval : Integer;
405
406                 //KuroutSettingTab \8fÚ\8d×\90Ý\92è\83^\83u\82ÌActiveTab
407                 FKuroutSettingTabIndex: Integer;
408
409                 //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[
410                 FGestures       : TGestureModel;
411                 //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[\82ð\8eg\97p\82·\82é\82©\82Ç\82¤\82©
412                 FGestureEnabled : Boolean;
413
414                                                                 //2ch\8c¾\8cê\90Ý\92è
415                                                                 F2chLanguage : TStringList;
416
417                 //\83t\83V\83A\83i\83g\83\89\83b\83v\90Ý\92è
418                 FLocalTrapAtt : Boolean;
419                 FRemoteTrapAtt : Boolean;
420                 
421                 function GetMainCoolSet(Index: Integer): TCoolSet;
422                 function GetBoardCoolSet(Index: Integer): TCoolSet;
423                 function GetBrowserCoolSet(Index: Integer): TCoolSet;
424                 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
425                 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
426                 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
427
428                 function GetBBSColumnWidth(index: Integer): Integer;
429                 function GetCategoryColumnWidth(index: Integer): Integer;
430                 function GetBoardColumnWidth(index: Integer): Integer;
431                 procedure SetBBSColumnWidth(index: Integer; value: Integer);
432                 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
433                 procedure SetBoardColumnWidth(index: Integer; value: Integer);
434
435                 function GetSoundName(Index: Integer): string;
436                 function GetSoundViewName(Index: Integer): string;
437                 function GetSoundFileName(Index: Integer): string;
438                 procedure SetSoundFileName(Index: Integer; value: string);
439                 function Encrypt(s: string): string;
440                 function Decrypt(s: string): string;
441
442                 procedure MakeURLIniFile();
443
444                 procedure SetUseCSS( value: Boolean );
445                 procedure SetCSSFileName( fileName: string );
446         protected
447
448         public
449                 constructor Create;
450                 destructor Destroy; override;
451                 function GetFileName: string;
452                 function GetBoardURLFileName: string;
453                 procedure ReadSettingFile;
454                 procedure ReadBoardURLsFile;
455                 procedure WriteSystemSettingFile;
456                 procedure WriteWindowSettingFile;
457                 procedure WriteNameMailSettingFile;
458                 procedure WriteFolderSettingFile();
459                 procedure WriteBoardURLSettingFile;
460                 function GetSoundCount: Integer;
461                 function FindSoundFileName(Name: string): string;
462
463                 function GetBoardFileName: string;
464                 function GetCustomBoardFileName: string;
465                 function GetBoardDir: string;
466                 function GetHtmlTempFileName: string;
467                 function GetAppDir: string;
468                 function GetTempFolder: string;
469                 function GetSentFileName: string;
470                 function GetConfigDir: string;
471                 function GetSkinDir: string;
472                 function GetSkinHeaderFileName: string;
473                 function GetSkinFooterFileName: string;
474                 function GetSkinResFileName: string;
475                 function GetSkinNewResFileName: string;
476                 function GetSkinBookmarkFileName: string;
477                 function GetSkinNewmarkFileName: string;
478                 function GetStyleSheetDir: string;
479                 function GetOutBoxFileName: string;
480                 function GetNGWordsDir: string;
481                 function GetBoardPlugInDir: string;
482                 function GetSambaFileName: string;
483                 function GetIgnoreFileName: string;
484                 function GetGestureFileName : string;
485                 function GetSpamFilterFileName : string;
486
487                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
488                 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
489                 //HTTP1.1\8eg\97p
490                 property Protocol: Boolean read FProtocol write FProtocol;
491                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
492                 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
493
494                 property ReadProxy: Boolean read FReadProxy write FReadProxy;
495                 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
496                 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
497                 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
498                 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
499
500                 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
501                 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
502                 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
503                 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
504                 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
505
506                 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
507                 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
508                 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
509                 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
510                 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
511                 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
512
513                 property ListFontName: string read FListFontName write FListFontName;
514                 property ListFontSize: Integer read FListFontSize write FListFontSize;
515                 property ListFontBold: Boolean read FListFontBold write FListFontBold;
516                 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
517                 property ListFontColor: TColor read FListFontColor write FListFontColor;
518                 property ListBackColor: TColor read FListBackColor write FListBackColor;
519
520                 property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
521                 property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
522                 property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
523                 property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
524                 property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
525                 property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
526
527                 property EditorFontName: string read FEditorFontName write FEditorFontName;
528                 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
529                 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
530                 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
531                 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
532                 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
533
534                 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
535                 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
536                 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
537                 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
538
539                 property HintFontName: string read FHintFontName write FHintFontName;
540                 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
541                 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
542                 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
543                 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
544                 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
545
546                 property WindowTop: Integer read FWindowTop write FWindowTop;
547                 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
548                 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
549                 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
550                 property WindowMax: Boolean read FWindowMax write FWindowMax;
551                 property ListStyle: TViewStyle read FListStyle write FListStyle;
552
553                 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
554                 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
555                 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
556                 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
557                 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
558                 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
559                 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
560
561                 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
562                 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
563                 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
564                 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
565
566                 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
567                 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
568
569                 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
570
571                 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
572                 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
573
574                 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
575                 property ListHeight: Integer read FListHeight write FListHeight;
576                 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
577                 property ListWidth: Integer read FListWidth write FListWidth;
578                 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
579 //              property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
580 //              property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
581
582                 property NameList: TStringList read FNameList write FNameList;
583                 property MailList: TStringList read FMailList write FMailList;
584                 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
585
586                 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
587                 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
588                 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
589                 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
590                 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
591                 property EditWindowStay: Boolean read FEditWindowStay write FEditWindowStay;
592                 property EditWindowTranslucent: Boolean read FEditWindowTranslucent write FEditWindowTranslucent;
593
594                 property ListViewNo: Boolean read FListViewNo write FListViewNo;
595                 property UseCSS: Boolean read FUseCSS write SetUseCSS;
596                 property CSSFileName: string read FCSSFileName write SetCSSFileName;
597                 property UseSkin: Boolean read FUseSkin;
598
599                 property ShowMail: Boolean read FShowMail write FShowMail;
600                 property ResRange : Longint read FResRange write FResRange;
601                 property ResRangeHold : Boolean read FResRangeHold write FResRangeHold;
602                 property ThreadRange    : TGikoThreadRange read FThreadRange write FThreadRange;
603                 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
604                 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
605
606                 property LogFolder: string read FLogFolder write FLogFolder;
607                 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
608
609                 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
610                 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
611                 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
612
613                 property BBSColumnOrder : TGikoBBSColumnList read FBBSColumnOrder write FBBSColumnOrder;
614                 property CategoryColumnOrder : TGikoCategoryColumnList read FCategoryColumnOrder write FCategoryColumnOrder;
615                 property BoardColumnOrder : TGikoBoardColumnList read FBoardColumnOrder write FBoardColumnOrder;
616
617                 property SoundName[index: Integer]: string read GetSoundName;
618                 property SoundViewName[index: Integer]: string read GetSoundViewName;
619                 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
620
621                 property BBSSortIndex: Integer read FBBSSortIndex write FBBSSortIndex;
622                 property BBSSortOrder: Boolean read FBBSSortOrder write FBBSSortOrder;
623                 property CategorySortIndex: Integer read FCategorySortIndex write FCategorySortIndex;
624                 property CategorySortOrder: Boolean read FCategorySortOrder write FCategorySortOrder;
625                 property BoardSortIndex: Integer read FBoardSortIndex write FBoardSortIndex;
626                 property BoardSortOrder: Boolean read FBoardSortOrder write FBoardSortOrder;
627
628                 property DatOchiSortIndex: Integer read FDatOchiSortIndex write FDatOchiSortIndex;
629                 property DatOchiSortOrder: Boolean read FDatOchiSortOrder write FDatOchiSortOrder;
630
631                 //property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
632                 property BoardURLs: TStringList read FBoardURLs write FBoardURLs;
633                 property BoardURLSelected: Integer read FBoardURLSelected write FBoardURLSelected;
634                 property UserID: string read FUserID write FUserID;
635                 property Password: string read FPassword write FPassword;
636                 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
637                 property ForcedLogin: Boolean read FForcedLogin write FForcedLogin;
638                 property DolibURL: string read FDolibURL write FDolibURL;
639
640                 property URLApp: Boolean read FURLApp write FURLApp;
641                 property URLAppFile: string read FURLAppFile write FURLAppFile;
642
643                 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
644
645                 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
646
647                 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
648                 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
649                 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
650
651                 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
652                 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
653
654                 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
655
656                 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
657                 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
658                 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
659                 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
660
661                 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
662                 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
663                 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
664                 property BrowserAutoMaximize: TGikoBrowserAutoMaximize read FBrowserAutoMaximize write FBrowserAutoMaximize;
665
666                 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
667                 property CreationTimeLogs: Boolean read FCreationTimeLogs write FCreationTimeLogs;
668                 property FutureThread: Boolean read FFutureThread write FFutureThread;
669
670                 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
671                 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
672                 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
673
674                 //\82 \82Ú\81`\82ñ
675                 property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
676                 property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
677                 property PopUpAbon               : Boolean read FPopUpAbon write FPopUpAbon;
678                 property ShowNGLinesNum : Boolean read FShowNGLinesNum write FShowNGLinesNum;
679                 property AddResAnchor : Boolean read FAddResAnchor write FAddResAnchor;
680                 property DeleteSyria : Boolean read FDeleteSyria write FDeleteSyria;
681                 // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
682                 property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
683
684                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83I\83v\83V\83\87\83\93\83_\83C\83A\83\8d\83O\82Ì\83^\83u
685                 property OptionDialogTabIndex : Integer read FOptionDialogTabIndex write FOptionDialogTabIndex;
686
687                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g
688                 property CabinetIndex : Integer read FCabinetIndex write FCabinetIndex;
689
690                 //\8fI\97¹\8e\9e\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é\82©
691                 property ShowDialogForEnd : Boolean read FShowDialogForEnd write FShowDialogForEnd;
692                 property ShowDialogForAllTabClose: Boolean read FShowDialogForAllTabClose write FShowDialogForAllTabClose;
693                 //\8eæ\93¾\83\8c\83X\90\94\82Æ\83X\83\8c\83b\83h\82Ì\83\8c\83X\90\94\82ª\88Ù\82È\82Á\82½\82Æ\82«\82É\92Ê\8fí\94w\8ci\90F\82Æ\88á\82Á\82½\90F\82Ì\94w\8ci\90F\82ð\8eg\97p\82·\82é\82©
694                 property UseOddColorOddResNum: Boolean read FUseOddColorOddResNum write FUseOddColorOddResNum;
695                 property OddColor: TColor read FOddColor write FOddColor;
696                 property UseSamba: Boolean read FUseSamba write FUseSamba;
697                 property ResAnchorJamp: Boolean read FResAnchorJamp write FResAnchorJamp;
698
699                 // \83G\83f\83B\83^
700                 property SpaceToNBSP    : Boolean       read FSpaceToNBSP               write FSpaceToNBSP;
701                 property AmpToCharRef   : Boolean       read FAmpToCharRef      write FAmpToCharRef;
702
703                 property SelectInterval : Integer       read FSelectInterval    write FSelectInterval;
704                 //Tab\95Û\91
705                 property TabAutoLoadSave: Boolean           read FTabAutoLoadSave      write FTabAutoLoadSave;
706                 property Gengo: TStringList read F2chLanguage write F2chLanguage;
707                 property GengoSupport : Boolean read F2chSupport write F2chSupport;
708                 property KuroutSettingTabIndex: Integer read FKuroutSettingTabIndex write FKuroutSettingTabIndex;
709                 //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[
710                 property Gestures : TGestureModel read FGestures write FGestures;
711                 //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[\82ð\8eg\97p\82·\82é\82©\82Ç\82¤\82©
712                 property GestureEnabled : Boolean read FGestureEnabled write FGestureEnabled;
713                 //\83t\83V\83A\83i\83g\83\89\83b\83v\90Ý\92è
714                 property LocalTrapAtt : Boolean read FLocalTrapAtt write FLocalTrapAtt;
715                 property RemoteTrapAtt : Boolean read FRemoteTrapAtt write FRemoteTrapAtt;
716
717 end;
718
719
720
721 implementation
722
723 type
724         TSoundName = record
725                 Name: string;
726                 ViewName: string;
727                 FileName: string;
728         end;
729
730 const
731         INI_FILE_NAME: string                            = 'gikoNavi.ini';
732         BOARD_URL_INI_FILE_NAME: string = 'url.ini';
733         DEFAULT_FONT_NAME: string                = '\82l\82\82o\83S\83V\83b\83N';
734         DEFAULT_FONT_SIZE: Integer              = 9;
735         DEFAULT_FONT_COLOR: string              = 'clWindowText';
736         DEFAULT_WINDOW_COLOR: string    = 'clWindow';
737         DEFAULT_TAB_FONT_NAME: string            = '\82l\82\82o\83S\83V\83b\83N';
738         DEFAULT_TAB_FONT_SIZE: Integer          = 9;
739         DEFAULT_2CH_BOARD_URL1: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
740         DEFAULT_2CH_BOARD_URL2: string = 'http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html';
741                                      //http://menu.2ch.net/bbsmenu.html //\82à\82¤\82·\82®\82±\82ê\82ª\90³\8e®\82È\94Â\88ê\97\97\82É\82È\82é\82æ\82¤
742                                                                                                                                 //'http://www.2ch.net/newbbsmenu.html';
743         GIKO_ENCRYPT_TEXT: string                = 'gikoNaviEncryptText';
744
745 var
746         SOUND_NAME: array[0..4] of TSoundName = (
747                 (Name: 'New';                           ViewName: '\8eæ\93¾\90¬\8c÷';                                    FileName: ''),
748                 (Name: 'NewDiff';               ViewName: '\8eæ\93¾\90¬\8c÷(\8d·\95ª)';              FileName: ''),
749                 (Name: 'NoChange';       ViewName: '\96¢\8dX\90V';                                             FileName: ''),
750 //              (Name: 'RoundEnd';       ViewName: '\8f\84\89ñ\8fI\97¹(\8eæ\93¾\82 \82è)'; FileName: ''),
751 //              (Name: 'RoundNone';     ViewName: '\8f\84\89ñ\8fI\97¹(\8eæ\93¾\82È\82µ)'; FileName: ''),
752                 (Name: 'ResEnd';                 ViewName: '\83\8c\83X\91\97\90M\8a®\97¹';                       FileName: ''),
753                 (Name: 'Error';                 ViewName: '\83G\83\89\81[';                                              FileName: ''));
754
755 constructor TGikoBBSColumnList.Create;
756 begin
757         inherited;
758 end;
759
760 destructor TGikoBBSColumnList.Destroy;
761 begin
762         inherited;
763 end;
764
765 function TGikoBBSColumnList.GetItem( index : integer ) : TGikoBBSColumnID;
766 begin
767         Result := TGikoBBSColumnID( inherited Items[ index ] );
768 end;
769
770 procedure TGikoBBSColumnList.SetItem( index : integer; value : TGikoBBSColumnID);
771 begin
772         inherited Items[ index ] := Pointer( value );
773 end;
774
775 function TGikoBBSColumnList.Add( value : TGikoBBSColumnID ) : Integer;
776 begin
777         Result := inherited Add( Pointer( value ) );
778 end;
779
780 constructor TGikoCategoryColumnList.Create;
781 begin
782         inherited;
783 end;
784
785 destructor TGikoCategoryColumnList.Destroy;
786 begin
787         inherited;
788 end;
789
790 function TGikoCategoryColumnList.GetItem( index : integer ) : TGikoCategoryColumnID;
791 begin
792         Result := TGikoCategoryColumnID( inherited Items[ index ] );
793 end;
794
795 procedure TGikoCategoryColumnList.SetItem( index : integer; value : TGikoCategoryColumnID);
796 begin
797         inherited Items[ index ] := Pointer( value );
798 end;
799
800 function TGikoCategoryColumnList.Add( value : TGikoCategoryColumnID ) : Integer;
801 begin
802         Result := inherited Add( Pointer( value ) );
803 end;
804
805 constructor TGikoBoardColumnList.Create;
806 begin
807         inherited;
808 end;
809
810 destructor TGikoBoardColumnList.Destroy;
811 begin
812         inherited;
813 end;
814
815 function TGikoBoardColumnList.GetItem( index : integer ) : TGikoBoardColumnID;
816 begin
817         Result := TGikoBoardColumnID( inherited Items[ index ] );
818 end;
819
820 procedure TGikoBoardColumnList.SetItem( index : integer; value : TGikoBoardColumnID);
821 begin
822         inherited Items[ index ] := Pointer( value );
823 end;
824
825 function TGikoBoardColumnList.Add( value : TGikoBoardColumnID ) : Integer;
826 begin
827         Result := inherited Add( Pointer( value ) );
828 end;
829
830 //\83R\83\93\83X\83g\83\89\83N\83^
831 constructor TSetting.Create();
832 begin
833         FNameList := TStringList.Create;
834         FMailList := TStringList.Create;
835         FSelectTextList := TStringList.Create;
836         FBoardURLs := TStringList.Create;
837         FBBSColumnOrder := TGikoBBSColumnList.Create;
838         FCategoryColumnOrder := TGikoCategoryColumnList.Create;
839         FBoardColumnOrder := TGikoBoardColumnList.Create;
840         FGestures := TGestureModel.Create;
841         FNameList.Duplicates := dupIgnore;
842         FMailList.Duplicates := dupIgnore;
843         FBoardURLs.Duplicates := dupIgnore;
844         FSelectTextList.Duplicates := dupIgnore;
845         ReadSettingFile();
846         ReadBoardURLsFile();
847 end;
848
849 //\83f\83X\83g\83\89\83N\83^
850 destructor TSetting.Destroy();
851 begin
852         inherited;
853         FBoardColumnOrder.Free;
854         FCategoryColumnOrder.Free;
855         FBBSColumnOrder.Free;
856         FSelectTextList.Free;
857         FBoardURLs.Free;
858         FMailList.Free;
859         FNameList.Free;
860         FGestures.Free;
861 end;
862
863 //\8f\89\8aú\89»\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
864 function TSetting.GetFileName(): string;
865 begin
866         Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
867 end;
868
869 //\94Â\8dX\90V\97pURL\90Ý\92è\83t\83@\83C\83\8b\96¼\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
870 function TSetting.GetBoardURLFileName(): string;
871 begin
872         Result := ExtractFilePath(Application.ExeName) + BOARD_URL_INI_FILE_NAME;
873 end;
874
875 //\90Ý\92è\83t\83@\83C\83\8b\93Ç\8d\9e
876 procedure TSetting.ReadSettingFile();
877 const
878         DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
879         DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130);
880         DEFAULT_BOARD_WIDTH: array[0..9] of Integer = (350, 60, 60, 60, 60, 60, 80, 130, 130, 130);
881         MAX_WIDTH: Integer = 2000;
882 var
883         ini: TMemIniFile;
884         i: Integer;
885         id, code : Integer;
886         wkList: TStringList;
887         wkStr: string;
888         Exists: Boolean;
889         s: string;                                               
890 //      id: Integer;
891         CoolSet: TCoolSet;
892 begin
893         Exists := FileExists(GetFileName);
894         ini := TMemIniFile.Create(GetFileName);
895         try
896                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
897                 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
898                 //HTTP1.1\8eg\97p
899                 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
900                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
901                 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
902
903                 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
904                 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
905                 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
906                 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
907                 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
908
909                 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
910                 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
911                 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
912                 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
913                 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
914
915                 FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
916                 FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
917                 FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
918                 FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
919                 FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
920                 FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
921
922                 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
923                 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
924                 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
925                 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
926                 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
927                 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
928
929                 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
930                 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
931                 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
932                 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
933                 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
934                 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
935                 FUseOddColorOddResNum := ini.ReadBool('Window','UseOddColor', False);
936                 FOddColor := StringToColor(ini.ReadString('Window', 'OddColor', DEFAULT_WINDOW_COLOR));
937
938                 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
939                 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
940                 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
941                 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
942                 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
943                 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
944
945                 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
946                 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
947                 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
948                 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
949
950                 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
951                 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
952                 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
953                 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
954                 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
955                 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
956
957                 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
958                 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
959                 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
960                 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
961                 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
962
963                 if FWindowHeight <= 0 then      FWindowHeight := 400;
964                 if FWindowWidth <= 0 then FWindowWidth := 600;
965
966                 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
967
968                 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
969                 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
970                 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
971                 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
972                 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
973                 FEditWindowStay := ini.ReadBool('EditorWindowSize', 'Stay', False);
974                 FEditWindowTranslucent := ini.ReadBool('EditorWindowSize', 'Translucent', False);
975
976                 FOptionDialogTabIndex := ini.ReadInteger('OptionDialog', 'TabIndex', 0);
977
978                 //\83c\81[\83\8b\83o\81[
979                 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
980                 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
981                 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
982                 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
983                 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
984                 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
985                 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
986                 //\83c\81[\83\8b\83o\81[Wrapable
987                 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
988                 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
989
990                 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
991                 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
992                 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
993                 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
994
995                 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
996                 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
997
998                 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
999
1000                 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
1001                 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
1002                 FCabinetIndex := ini.ReadInteger('Cabinet', 'Index', 0);
1003
1004                 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
1005                 FListHeight := ini.ReadInteger('List', 'Height', 180);
1006                 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
1007                 FListWidth := ini.ReadInteger('List', 'Width', 180);
1008                 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
1009 //              FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
1010 //              FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
1011
1012                 wkList := TStringList.Create;
1013                 try
1014                         ini.ReadSection('Name', wkList);
1015                         for i := 0 to wkList.Count - 1 do begin
1016                                 wkStr := ini.ReadString('Name', wkList[i], '');
1017                                 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
1018                                         FNameList.Add(wkStr);
1019                         end;
1020                         ini.ReadSection('Mail', wkList);
1021                         for i := 0 to wkList.Count - 1 do begin
1022                                 wkStr := ini.ReadString('Mail', wkList[i], '');
1023                                 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
1024                                         FMailList.Add(wkStr);
1025                         end;
1026                         ini.ReadSection('SelectText', wkList);
1027                         for i := 0 to wkList.Count - 1 do begin
1028                                 wkStr := ini.ReadString('SelectText', wkList[i], '');
1029                                 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
1030                                         FSelectTextList.Add(wkStr);
1031                         end;
1032                 finally
1033                         wkList.Free;
1034                 end;
1035
1036                 // \83\8a\83X\83g\83J\83\89\83\80\95\9d
1037                 wkList := TStringList.Create;
1038                 try
1039                         ini.ReadSection('BBSColumnWidth', wkList);
1040                         if Length(FBBSColumnWidth) <> wkList.Count then begin
1041                                 ini.EraseSection('BBSColumnWidth');
1042                         end;
1043                         for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1044                                 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
1045                                 if BBSColumnWidth[i] > MAX_WIDTH then
1046                                         BBSColumnWidth[i] := DEFAULT_BBS_WIDTH[i];
1047                         end;
1048                         ini.ReadSection('CategoryColumnWidth', wkList);
1049                         if Length(FCategoryColumnWidth) <> wkList.Count then begin
1050                                 ini.EraseSection('CategoryColumnWidth');
1051                         end;
1052                         for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1053                                 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
1054                                 if CategoryColumnWidth[i] > MAX_WIDTH then
1055                                         CategoryColumnWidth[i] := DEFAULT_CATEGORY_WIDTH[i];
1056                         end;
1057                         ini.ReadSection('BoardColumnWidth', wkList);
1058                         if Length(FBoardColumnWidth) <> wkList.Count then begin
1059                                 ini.EraseSection('BoardColumnWidth');
1060                         end;
1061                         for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1062                                 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
1063                                 if BoardColumnWidth[i] > MAX_WIDTH then
1064                                         BoardColumnWidth[i] := DEFAULT_BOARD_WIDTH[i];
1065                         end;
1066                 finally
1067                         wkList.Free;
1068                 end;
1069
1070                 // \83J\83e\83S\83\8a\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
1071                 wkList := TStringList.Create;
1072                 try
1073                         ini.ReadSection( 'BBSColumnOrder', wkList );
1074                         for i := 0 to wkList.Count - 1 do begin
1075                                 wkStr := ini.ReadString( 'BBSColumnOrder', 'ID' + IntToStr( i ), '' );
1076                                 Val( wkStr, id, code );
1077                                 if code = 0 then
1078                                         FBBSColumnOrder.Add( TGikoBBSColumnID( id ) );
1079                         end;
1080                         if FBBSColumnOrder.Count = 0 then begin
1081                                 // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
1082                                 for i := 0 to Integer( High( TGikoBBSColumnID ) ) do
1083                                         FBBSColumnOrder.Add( TGikoBBSColumnID( i ) );
1084                         end;
1085
1086                         ini.ReadSection( 'CategoryColumnOrder', wkList );
1087                         for i := 0 to wkList.Count - 1 do begin
1088                                 wkStr := ini.ReadString( 'CategoryColumnOrder', 'ID' + IntToStr( i ), '' );
1089                                 Val( wkStr, id, code );
1090                                 if code = 0 then
1091                                         FCategoryColumnOrder.Add( TGikoCategoryColumnID( id ) );
1092                         end;
1093                         if FCategoryColumnOrder.Count = 0 then begin
1094                                 // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
1095                                 for i := 0 to Integer( High( TGikoCategoryColumnID ) ) do
1096                                         FCategoryColumnOrder.Add( TGikoCategoryColumnID( i ) );
1097                         end;
1098
1099                         ini.ReadSection( 'BoardColumnOrder', wkList );
1100                         for i := 0 to wkList.Count - 1 do begin
1101                                 wkStr := ini.ReadString( 'BoardColumnOrder', 'ID' + IntToStr( i ), '' );
1102                                 Val( wkStr, id, code );
1103                                 if code = 0 then
1104                                         FBoardColumnOrder.Add( TGikoBoardColumnID( id ) );
1105                         end;
1106                         if FBoardColumnOrder.Count = 0 then begin
1107                                 // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
1108                                 for i := 0 to Integer( High( TGikoBoardColumnID ) ) do
1109                                         FBoardColumnOrder.Add( TGikoBoardColumnID( i ) );
1110                         end;
1111                 finally
1112                         wkList.Free;
1113                 end;
1114
1115                 //\83\8a\83X\83g\94Ô\8d\86
1116                 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
1117                 //CSS
1118                 UseCSS := ini.ReadBool('CSS', 'UseCSS', True);
1119                 //CSS\83t\83@\83C\83\8b\96¼
1120                 CSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
1121
1122                 //Mail\97\93\95\\8e¦
1123                 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
1124                 // \83\8c\83X\95\\8e¦\94Í\88Í
1125                 if ini.ReadBool('Thread', 'OnlyAHundredRes',false) then
1126                         FResRange := 100        // \8cÃ\82¢\90Ý\92è\82Ì\8cÝ\8a·\97p
1127                 else
1128                         FResRange := ini.ReadInteger( 'Thread', 'ResRange', Ord( grrAll ) );
1129                 FResRangeHold := ini.ReadBool( 'Thread', 'ResRangeHold', False );
1130                 // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
1131                 FThreadRange := TGikoThreadRange( ini.ReadInteger('ThreadList', 'ThreadRange', Ord( gtrAll )) );
1132                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
1133                 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
1134                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
1135                 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
1136                 //\8dí\8f\9c\8am\94F
1137                 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
1138                 //\8fI\97¹\8am\94F
1139                 FShowDialogForEnd := ini.ReadBool('Function','ShowDialogForEnd',false);
1140                 //AllTabClose
1141                 FShowDialogForAllTabClose := ini.ReadBool('Function','ShowDialogForAllTabClose',false);
1142                 //Samba
1143                 FUseSamba := ini.ReadBool('Function','UseSamba', True);
1144                 //ResAnchorjamp
1145                 ResAnchorJamp := ini.ReadBool('Function', 'ResAnchoJamp', True);
1146                 //\83\8d\83O\83t\83H\83\8b\83_
1147                 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
1148                 NewLogFolder := '';
1149
1150                 //\94ÂURL
1151                 //\95¡\90\94\93o\98^\82Å\82«\82é\82æ\82¤\82É\82µ\82ÄFBoardURLs\82É\82µ\82½\81@2003/10/05
1152                 //FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
1153
1154                 //\94F\8fØ\97p\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
1155                 FUserID := ini.ReadString('Attestation', 'UserID', '');
1156                 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
1157                 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
1158                 FForcedLogin := ini.ReadBool('Attestation', 'FForcedLogin', False);
1159 //              FDolibURL       := ini.ReadString('Attestation', 'FDolibURL', DOLIB_LOGIN_URL);
1160
1161                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
1162                 FURLApp := ini.ReadBool('URLApp', 'Select', False);
1163                 FURLAppFile := ini.ReadString('URLApp', 'File', '');
1164
1165                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
1166                 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
1167
1168                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
1169                 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
1170
1171                 //\83A\83h\83\8c\83X\83o\81[
1172                 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
1173                 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
1174                 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
1175                 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
1176
1177                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
1178                 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
1179                 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
1180                 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
1181
1182                 // \83u\83\89\83E\83U
1183                 FBrowserAutoMaximize := TGikoBrowserAutoMaximize(
1184                         ini.ReadInteger('Window', 'BrowserAutoMaximize', Ord(gbmDoubleClick)) );
1185
1186                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
1187                 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
1188                 FCreationTimeLogs := ini.ReadBool('ThreadList', 'CreationTimeLogs', True);
1189                 FFutureThread := ini.ReadBool('ThreadList', 'FutureThread', True);
1190                 FSelectInterval := ini.ReadInteger('ThreadList', 'SelectInterval', 110);
1191                 //\83\\81[\83g\8f\87
1192                 FBBSSortIndex := ini.ReadInteger('ThreadList', 'BBSSortIndex', 0);
1193                 FBBSSortOrder := ini.ReadBool('ThreadList', 'BBSSortOrder', True);
1194                 FCategorySortIndex := ini.ReadInteger('ThreadList', 'CategorySortIndex', 0);
1195                 FCategorySortOrder := ini.ReadBool('ThreadList', 'CategorySortOrder', True);
1196                 FBoardSortIndex := ini.ReadInteger('ThreadList', 'BoardSortIndex', 0);
1197                 FBoardSortOrder := ini.ReadBool('ThreadList', 'BoardSortOrder', True);
1198                 //Dat\97\8e\82¿\83X\83\8c\83\\81[\83g\8f\87
1199                 FDatOchiSortIndex := ini.ReadInteger('ThreadList', 'DatOchiSortIndex', -1);
1200                 FDatOchiSortOrder := ini.ReadBool('ThreadList', 'DatOchiSortOrder', False);
1201
1202                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8d\8f\8eg\97p\90Ý\92è
1203                 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
1204                 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
1205                 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
1206
1207                 //\83T\83E\83\93\83h
1208                 if Exists then begin
1209                         for i := 0 to GetSoundCount - 1 do begin
1210                                 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
1211                                 if not FileExists(SoundFileName[i]) then
1212                                         SoundFileName[i] := '';
1213                         end;
1214                 end else begin
1215                         s := ExtractFileDir(Application.ExeName) + '\sound\';
1216                         SoundFileName[0] := s + '\8eæ\93¾\90¬\8c÷.wav';
1217                         SoundFileName[1] := s + '\8eæ\93¾\90¬\8c÷(\8d·\95ª).wav';
1218                         SoundFileName[2] := s + '\96¢\8dX\90V.wav';
1219                         SoundFileName[3] := '';
1220                         SoundFileName[4] := s + '\83G\83\89\81[.wav';
1221                 end;
1222
1223                 //\83N\81[\83\8b\83o\81[
1224                 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1225                         CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
1226                         CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
1227                         CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
1228                         MainCoolSet[i] := CoolSet;
1229                 end;
1230                 FSelectComboBoxWidth := ini.ReadInteger( 'ListCoolBar', 'SelectWidth', 127 );
1231                 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1232                         CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
1233                         CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
1234                         CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
1235                         ListCoolSet[i] := CoolSet;
1236                 end;
1237                 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1238                         CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
1239                         CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
1240                         CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
1241                         BrowserCoolSet[i] := CoolSet;
1242                 end;
1243
1244                 //\82 \82Ú\81`\82ñ
1245                 FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
1246                 FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
1247                 FPopUpAbon               := ini.ReadBool('Abon','Popup',false);
1248                 FShowNGLinesNum := ini.ReadBool('Abon','ShowNGLines',false);
1249                 FAddResAnchor := ini.ReadBool('Abon','AddResAnchor',false);
1250                 FDeleteSyria :=  ini.ReadBool('Abon','DeleteSyria',false);
1251
1252                 // \83G\83f\83B\83^
1253                 FSpaceToNBSP    := ini.ReadBool( 'Editor', 'SpaceToNBSP', False );
1254                 FAmpToCharRef   := ini.ReadBool( 'Editor', 'AmpToCharRef', False );
1255
1256                 //Tab\8e©\93®\95Û\91\81A\93Ç\82Ý\8d\9e\82Ý
1257                 FTabAutoLoadSave    := ini.ReadBool('TabAuto', 'TabAutoLoadSave', False);
1258
1259                 FKuroutSettingTabIndex := ini.ReadInteger('OptionDialog', 'KuroutTabIndex' , 0);
1260
1261                 // \83}\83E\83X\83W\83F\83X\83`\83\83\81[
1262                 FGestureEnabled := ini.ReadBool( 'Guesture', 'Enabled', False );
1263
1264                 //2ch\8c¾\8cê\83T\83|
1265                 F2chSupport := ini.ReadBool('2chSupport', 'Support', False);
1266
1267                 //FusianaTrap
1268                                 FLocalTrapAtt := ini.ReadBool('Trap', 'LocalTrap', False);
1269                                 FRemoteTrapAtt := ini.ReadBool('Trap', 'RemoteTrap', False);
1270
1271                 ini.UpdateFile;
1272         finally
1273                 ini.Free;
1274         end;
1275 end;
1276 //\94Â\8dX\90V\97pURL\93Ç\82Ý\8d\9e\82Ý
1277 procedure TSetting.ReadBoardURLsFile();
1278 var
1279         ini: TMemIniFile;
1280         urlNum: Integer;
1281         i : Integer;
1282 begin
1283         if not FileExists(GetBoardURLFileName()) then
1284         MakeURLIniFile();
1285         ini := TMemIniFile.Create(GetBoardURLFileName());
1286         try
1287                 urlNum := ini.ReadInteger('URL','count',0);
1288                 BoardURLSelected := ini.ReadInteger('URL','selected',0);
1289                 for i := 0 to urlNum - 1 do begin
1290                         FBoardURLs.Append(ini.ReadString('URL',IntToStr(i+1),''));
1291                 end;
1292         finally
1293                 ini.Free;
1294         end;
1295
1296 end;
1297 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(system)
1298 procedure TSetting.WriteSystemSettingFile();
1299 var
1300         ini: TMemIniFile;
1301 begin
1302         ini := TMemIniFile.Create(GetFileName());
1303         try
1304                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
1305                 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
1306                 //HTTP1.1\8eg\97p
1307                 ini.WriteBool('HTTP', 'Protocol', FProtocol);
1308                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
1309                 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
1310
1311                 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
1312                 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
1313                 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
1314                 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
1315                 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
1316
1317                 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
1318                 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
1319                 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
1320                 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
1321                 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
1322
1323                 ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
1324                 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
1325                 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
1326                 ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
1327                 ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
1328                 ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
1329                 ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
1330
1331                 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
1332                 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
1333                 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
1334                 ini.WriteBool('Window', 'CabinetFontBold', FCabinetFontBold);
1335                 ini.WriteBool('Window', 'CabinetFontItalic', FCabinetFontItalic);
1336                 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
1337
1338                 ini.WriteString('Window', 'ListFontName', FListFontName);
1339                 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
1340                 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
1341                 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
1342                 ini.WriteBool('Window', 'ListFontBold', FListFontBold);
1343                 ini.WriteBool('Window', 'ListFontItalic', FListFontItalic);
1344                                 ini.WriteBool('Window','UseOddColor',FUseOddColorOddResNum);
1345                 ini.WriteString('Window', 'OddColor',ColorToString(FOddColor));
1346
1347                 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
1348                 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
1349                 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
1350                 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
1351
1352                 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
1353                 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
1354                 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
1355                 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
1356
1357                 ini.WriteString('Window', 'HintFontName', FHintFontName);
1358                 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
1359                 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
1360                 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
1361
1362                 ini.UpdateFile;
1363         finally
1364                 ini.Free;
1365         end;
1366 end;
1367
1368 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(window)
1369 procedure TSetting.WriteWindowSettingFile();
1370 var
1371         i: Integer;
1372         ini: TMemIniFile;
1373         CoolSet: TCoolSet;
1374         wkList  : TStringList;
1375 begin
1376         ini := TMemIniFile.Create(GetFileName());
1377         try
1378                 ini.WriteInteger('WindowSize', 'Top', WindowTop);
1379                 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
1380                 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
1381                 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
1382                 ini.WriteBool('WindowSize', 'Max', WindowMax);
1383
1384                 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
1385
1386                 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
1387                 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
1388                 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
1389                 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
1390                 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
1391                 ini.WriteBool('EditorWindowSize', 'Stay', EditWindowStay);
1392                 ini.WriteBool('EditorWindowSize', 'Translucent', EditWindowTranslucent);
1393
1394                 ini.WriteInteger('OptionDialog', 'TabIndex', FOptionDialogTabIndex);
1395
1396                 //\83c\81[\83\8b\83o\81[
1397                 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
1398                 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
1399                 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
1400                 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
1401                 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
1402                 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
1403                 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
1404                 //\83c\81[\83\8b\83o\81[Wrapable
1405                 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
1406                 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
1407
1408                 //\83^\83u
1409                 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
1410                 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
1411                 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
1412                 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
1413
1414                 //\83\81\83b\83Z\81[\83W\83o\81[
1415                 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
1416                 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
1417
1418                 //\83X\83e\81[\83^\83X\83o\81[
1419                 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
1420
1421                 //\83L\83\83\83r\83l\83b\83g
1422                 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
1423                 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
1424                 ini.WriteInteger('Cabinet', 'Index', FCabinetIndex);
1425
1426                 //\83\8a\83X\83g\82Ì\83T\83C\83Y\82Æ\90\82\92¼\90\85\95½
1427                 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
1428                 ini.WriteInteger('List', 'Height', FListHeight);
1429                 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
1430                 ini.WriteInteger('List', 'Width', FListWidth);
1431                 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
1432 //              ini.WriteBool('List', 'HeightMax', FListHeightMax);
1433 //              ini.WriteBool('List', 'WidthMax', FListWidthMax);
1434
1435
1436 //              ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
1437
1438                 //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦
1439                 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
1440                 //CSS\8eg\97p
1441                 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1442                 //CSS\83t\83@\83C\83\8b\96¼
1443                 ini.WriteString('CSS', 'FileName', FCSSFileName);
1444                 //Mail\97\93\95\\8e¦
1445                 ini.WriteBool('Thread', 'ShowMail', FShowMail);
1446                 // \83\8c\83X\95\\8e¦\94Í\88Í
1447                 ini.DeleteKey( 'Thread', 'OnlyAHundredRes' );   // \8cÃ\82¢\90Ý\92è\82Ì\8dí\8f\9c
1448                 ini.WriteInteger('Thread', 'ResRange', FResRange);
1449                 ini.WriteBool('Thread', 'ResRangeHold', FResRangeHold);
1450                 // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
1451                 ini.WriteInteger('ThreadList', 'ThreadRange', Ord( FThreadRange ));
1452                 //\83\8d\83O\8dí\8f\9c\8am\94F
1453                 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1454                 //\8fI\97¹\8am\94F
1455                 ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1456                 //AllTabClose
1457                 ini.WriteBool('Function','ShowDialogForAllTabClose', FShowDialogForAllTabClose);
1458                 //Samba
1459                 ini.WriteBool('Function','UseSamba', FUseSamba);
1460                 //ResAnchorjamp
1461                 ini.WriteBool('Function', 'ResAnchoJamp', ResAnchorJamp);
1462
1463                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
1464                 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1465                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
1466                 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1467                 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1468
1469                 //\94F\8fØ\97p\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
1470                 ini.WriteString('Attestation', 'UserID', FUserID);
1471                 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
1472                 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
1473                 ini.WriteBool('Attestation', 'FForcedLogin', FForcedLogin);
1474                 ini.WriteString('Attestation', 'FDolibURL', FDolibURL);
1475
1476                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
1477                 ini.WriteBool('URLApp', 'Select', FURLApp);
1478                 ini.WriteString('URLApp', 'File', FURLAppFile);
1479
1480                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
1481                 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1482
1483                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
1484                 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1485
1486                 //\83A\83h\83\8c\83X\83o\81[
1487                 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
1488                 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
1489                 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
1490                 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
1491
1492                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
1493                 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1494                 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1495                 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1496
1497                 ini.WriteInteger('Window', 'BrowserAutoMaximize', Ord( BrowserAutoMaximize ) );
1498
1499                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
1500                 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1501                 ini.WriteBool('ThreadList', 'CreationTimeLogs',FCreationTimeLogs);
1502                 ini.WriteBool('ThreadList', 'FutureThread', FFutureThread);
1503                 ini.WriteInteger('ThreadList', 'SelectInterval', FSelectInterval);
1504                 //\83\\81[\83g\8f\87
1505                 ini.WriteInteger('ThreadList', 'BBSSortIndex', FBBSSortIndex);
1506                 ini.WriteBool('ThreadList', 'BBSSortOrder', FBBSSortOrder);
1507                 ini.WriteInteger('ThreadList', 'CategorySortIndex', FCategorySortIndex);
1508                 ini.WriteBool('ThreadList', 'CategorySortOrder', FCategorySortOrder);
1509                 ini.WriteInteger('ThreadList', 'BoardSortIndex', FBoardSortIndex);
1510                 ini.WriteBool('ThreadList', 'BoardSortOrder', FBoardSortOrder);
1511                 ini.WriteInteger('ThreadList', 'DatOchiSortIndex', FDatOchiSortIndex);
1512                 ini.WriteBool('ThreadList', 'DatOchiSortOrder', FDatOchiSortOrder);
1513
1514                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8d\8f\8eg\97p\90Ý\92è
1515                 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1516                 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1517                 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1518
1519                 // \83\8a\83X\83g\83J\83\89\83\80\95\9d
1520                 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1521                         ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
1522                 end;
1523                 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1524                         ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
1525                 end;
1526                 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1527                         ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
1528                 end;
1529
1530                 wkList := TStringList.Create;
1531                 try
1532                         // \83J\83e\83S\83\8a\83\8a\83X\83g\8f\87\8f\98
1533                         ini.ReadSection( 'BBSColumnOrder', wkList );
1534                         for i := wkList.Count - 1 downto 0 do
1535                                 ini.DeleteKey( 'BBSColumnOrder', wkList[ i ] );
1536                         for i := 0 to FBBSColumnOrder.Count - 1 do
1537                                 ini.WriteInteger( 'BBSColumnOrder', 'ID' + IntToStr( i ), Ord( FBBSColumnOrder[ i ] ) );
1538
1539                         // \94Â\83\8a\83X\83g\8f\87\8f\98
1540                         ini.ReadSection( 'CategoryColumnOrder', wkList );
1541                         for i := wkList.Count - 1 downto 0 do
1542                                 ini.DeleteKey( 'CategoryColumnOrder', wkList[ i ] );
1543                         for i := 0 to FCategoryColumnOrder.Count - 1 do
1544                                 ini.WriteInteger( 'CategoryColumnOrder', 'ID' + IntToStr( i ), Ord( FCategoryColumnOrder[ i ] ) );
1545
1546                         // \83X\83\8c\83\8a\83X\83g\8f\87\8f\98
1547                         ini.ReadSection( 'BoardColumnOrder', wkList );
1548                         for i := wkList.Count - 1 downto 0 do
1549                                 ini.DeleteKey( 'BoardColumnOrder', wkList[ i ] );
1550                         for i := 0 to FBoardColumnOrder.Count - 1 do
1551                                 ini.WriteInteger( 'BoardColumnOrder', 'ID' + IntToStr( i ), Ord( FBoardColumnOrder[ i ] ) );
1552                 finally
1553                         wkList.Free;
1554                 end;
1555
1556                 //\83T\83E\83\93\83h
1557                 for i := 0 to GetSoundCount - 1 do begin
1558                         if not FileExists(SoundFileName[i]) then
1559                                 SoundFileName[i] := '';
1560                         ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
1561                 end;
1562
1563                 //CoolBar
1564                 ini.EraseSection('MainCoolBar');
1565                 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1566                         CoolSet := MainCoolSet[i];
1567                         ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1568                         ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1569                         ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1570                 end;
1571                 ini.EraseSection('ListCoolBar');
1572                 ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1573                 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1574                         CoolSet := ListCoolSet[i];
1575                         ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1576                         ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1577                         ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1578                 end;
1579                 ini.EraseSection('BrowserCoolBar');
1580                 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1581                         CoolSet := BrowserCoolSet[i];
1582                         ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1583                         ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1584                         ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1585                 end;
1586
1587                 //\82 \82Ú\81`\82ñ
1588                 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1589                 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1590                                 ini.WriteBool('Abon','Popup',FPopUpAbon);
1591                 ini.WriteBool('Abon','ShowNGLines',FShowNGLinesNum);
1592                 ini.WriteBool('Abon','AddResAnchor',FAddResAnchor);
1593                                 ini.WriteBool('Abon','DeleteSyria',FDeleteSyria);
1594
1595                 // \83G\83f\83B\83^
1596                 ini.WriteBool( 'Editor', 'SpaceToNBSP', FSpaceToNBSP );
1597                 ini.WriteBool( 'Editor', 'AmpToCharRef', FAmpToCharRef );
1598
1599                 //\83^\83u\8e©\93®\95Û\91
1600                 ini.WriteBool('TabAuto', 'TabAutoLoadSave', FTabAutoLoadSave);
1601                 //\8fÚ\8d×\90Ý\92è
1602                 ini.WriteInteger('OptionDialog', 'KuroutTabIndex', FKuroutSettingTabIndex);
1603
1604                 //\82É\82¿\82á\82ñ\8cê\88Ä\93à\8b@\94\
1605                 ini.WriteBool('2chSupport', 'Support', F2chSupport);
1606
1607                 // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\82ð\8eg\97p\82·\82é\82©\82Ç\82¤\82©
1608                 ini.WriteBool( 'Guesture', 'Enabled', FGestureEnabled );
1609
1610                 //FusianaTrap
1611                                 ini.WriteBool('Trap', 'LocalTrap', FLocalTrapAtt);
1612                                 ini.WriteBool('Trap', 'RemoteTrap', FRemoteTrapAtt);
1613
1614                 ini.UpdateFile;
1615         finally
1616                 ini.Free;
1617         end;
1618 end;
1619
1620 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(name & mail)
1621 procedure TSetting.WriteNameMailSettingFile();
1622 var
1623         i: Integer;
1624         ini: TMemIniFile;
1625 begin
1626         ini := TMemIniFile.Create(GetFileName());
1627         try
1628                 ini.EraseSection('Name');
1629                 ini.EraseSection('Mail');
1630                 ini.EraseSection('SelectText');
1631                 for i := 0 to FNameList.Count - 1 do begin
1632                         ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1633                         if i >= 39 then
1634                                 Break;
1635                 end;
1636                 for i := 0 to FMailList.Count - 1 do begin
1637                         ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1638                         if i >= 39 then
1639                                 Break;
1640                 end;
1641                 for i := 0 to FSelectTextList.Count - 1 do begin
1642                         ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1643                         if i >= 39 then
1644                                 Break;
1645                 end;
1646                 ini.UpdateFile;
1647         finally
1648                 ini.Free;
1649         end;
1650 end;
1651
1652 procedure TSetting.WriteFolderSettingFile();
1653 var
1654         ini: TMemIniFile;
1655 begin
1656         ini := TMemIniFile.Create(GetFileName());
1657         try
1658                 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1659                         ini.DeleteKey('Folder', 'LogFolder')
1660                 else
1661                         ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1662                 ini.UpdateFile;
1663         finally
1664                 ini.Free;
1665         end;
1666 end;
1667 //\94Â\8dX\90V\97pBoardURL\82ð\95Û\91
1668 procedure TSetting.WriteBoardURLSettingFile();
1669 var
1670         ini: TMemIniFile;
1671                 i : Integer;
1672                 oldcount : Integer;
1673 begin
1674         ini := TMemIniFile.Create(GetBoardURLFileName());
1675         try
1676                 oldcount := ini.ReadInteger('URL','count',FBoardURLs.Count);
1677                 ini.WriteInteger('URL','count',FBoardURLs.Count);
1678                 ini.WriteInteger('URL','selected',BoardURLSelected);
1679                 for i := 0 to FBoardURLs.Count -1 do begin
1680                                         ini.WriteString('URL',IntToStr(i+1),FBoardURLs.Strings[i]);
1681                 end;
1682                 if oldcount > FBoardURLs.Count then begin
1683                         for i := FBoardURLs.Count to oldcount do begin
1684                                 ini.DeleteKey('URL',IntToStr(i+1));
1685                         end;
1686                 end;
1687                 ini.UpdateFile;
1688         finally
1689                 ini.Free;
1690         end;
1691 end;
1692
1693 {$R-}
1694 //\83\8a\83X\83g\83J\83\89\83\80\83w\83b\83_\81[
1695 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1696 begin
1697         Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1698 end;
1699
1700 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1701 begin
1702         Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1703 end;
1704
1705 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1706 begin
1707         Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1708 end;
1709 {$IFDEF DEBUG}
1710 {$R+}
1711 {$ENDIF}
1712
1713 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1714 begin
1715         if index in [0..Length(FBBSColumnWidth) - 1] then
1716                 FBBSColumnWidth[index] := value;
1717 end;
1718
1719 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1720 begin
1721         if index in [0..Length(FCategoryColumnWidth) - 1] then
1722                 FCategoryColumnWidth[index] := value;
1723 end;
1724
1725 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1726 begin
1727         if index in [0..Length(FBoardColumnWidth) - 1] then
1728                 FBoardColumnWidth[index] := value;
1729 end;
1730
1731 function TSetting.GetSoundCount: Integer;
1732 begin
1733         Result := Length(SOUND_NAME);
1734 end;
1735
1736 function TSetting.GetSoundName(Index: Integer): string;
1737 begin
1738         if (Index < GetSoundCount) and (Index >= 0) then
1739                 Result := SOUND_NAME[Index].Name
1740         else
1741                 Result := '';
1742 end;
1743
1744 function TSetting.GetSoundViewName(Index: Integer): string;
1745 begin
1746         if (Index < GetSoundCount) and (Index >= 0) then
1747                 Result := SOUND_NAME[Index].ViewName
1748         else
1749                 Result := '';
1750 end;
1751
1752 function TSetting.GetSoundFileName(Index: Integer): string;
1753 begin
1754         if (Index < GetSoundCount) and (Index >= 0) then
1755                 Result := SOUND_NAME[Index].FileName
1756         else
1757                 Result := '';
1758 end;
1759
1760 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1761 begin
1762         if (Index < GetSoundCount) and (Index >= 0) then
1763                 SOUND_NAME[Index].FileName := value;
1764 end;
1765
1766 function TSetting.FindSoundFileName(Name: string): string;
1767 var
1768         i: Integer;
1769 begin
1770         for i := 0 to GetSoundCount - 1 do begin
1771                 if SoundName[i] = Name then begin
1772                         Result := SoundFileName[i];
1773                         Exit;
1774                 end;
1775         end;
1776         Result := '';
1777 end;
1778
1779 function TSetting.Encrypt(s: string): string;
1780 var
1781         cryptObj: THogeCryptAuto;
1782         inputStream, outputStream: TStringStream;
1783 begin
1784         inputStream := TStringStream.Create(s);
1785         outputStream := TStringStream.Create('');
1786         cryptObj := THogeCryptAuto.Create;
1787         try
1788                 // \88Ã\8d\86\89»
1789                 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1790
1791                 // \83o\83C\83i\83\8a\82È\82Ì\82Å\95K\97v\82É\89\9e\82\82Ä\83e\83L\83X\83g\82É\95Ï\8a·
1792                 Result := HogeBase64Encode(outputStream.DataString);
1793         finally
1794                 cryptObj.Free;
1795                 outputStream.Free;
1796                 inputStream.Free;
1797         end;
1798 end;
1799
1800 function TSetting.Decrypt(s: string): string;
1801 var
1802         cryptObj: THogeCryptAuto;
1803         inputStream, outputStream: TStringStream;
1804 begin
1805         try
1806                 inputStream := TStringStream.Create(HogeBase64Decode(s));
1807         except
1808                 Result := '';
1809                 Exit;
1810         end;
1811         outputStream := TStringStream.Create('');
1812         cryptObj := THogeCryptAuto.Create;
1813         try
1814                 // \95\9c\8d\86
1815                 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1816                 Result := outputStream.DataString;
1817         finally
1818                 cryptObj.Free;
1819                 outputStream.Free;
1820                 inputStream.Free;
1821         end;
1822 end;
1823
1824 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1825 begin
1826         if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1827                 Result := FMainCoolBar[Index]
1828         else begin
1829                 Result.FCoolID := -1;
1830                 Result.FCoolWidth := -1;
1831                 Result.FCoolBreak := False;
1832         end;
1833 end;
1834
1835 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1836 begin
1837         if Index in [0..LIST_COOLBAND_COUNT - 1] then
1838                 Result := FListCoolBar[Index]
1839         else begin
1840                 Result.FCoolID := -1;
1841                 Result.FCoolWidth := -1;
1842                 Result.FCoolBreak := False;
1843         end;
1844 end;
1845
1846 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1847 begin
1848         if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1849                 Result := FBrowserCoolBar[Index]
1850         else begin
1851                 Result.FCoolID := -1;
1852                 Result.FCoolWidth := -1;
1853                 Result.FCoolBreak := False;
1854         end;
1855 end;
1856
1857 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1858 begin
1859         if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1860                 FMainCoolBar[Index] := CoolSet;
1861 end;
1862
1863 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1864 begin
1865         if Index in [0..LIST_COOLBAND_COUNT - 1] then
1866                 FListCoolBar[Index] := CoolSet;
1867 end;
1868
1869 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1870 begin
1871         if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1872                 FBrowserCoolBar[Index] := CoolSet;
1873 end;
1874
1875 //url.ini\82ª\82È\82¢\82Æ\82«\82É\90\90¬\82·\82é
1876 procedure TSetting.MakeURLIniFile();
1877 var
1878         ini: TMemIniFile;
1879 begin
1880         ini := TMemIniFile.Create(GetBoardURLFileName());
1881         try
1882                 ini.WriteInteger('URL','count',2);
1883                 ini.WriteInteger('URL','selected',2);
1884                 ini.WriteString('URL','1',DEFAULT_2CH_BOARD_URL1);
1885                 ini.WriteString('URL','2',DEFAULT_2CH_BOARD_URL2);
1886                 ini.UpdateFile;
1887         finally
1888                 ini.Free;
1889         end;
1890 end;
1891
1892 (*************************************************************************
1893  *\83{\81[\83h\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1894  *************************************************************************)
1895 function TSetting.GetBoardFileName: string;
1896 begin
1897         Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_FILE_NAME;
1898 end;
1899
1900 (*************************************************************************
1901  *\83{\81[\83h\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1902  *************************************************************************)
1903 function TSetting.GetCustomBoardFileName: string;
1904 begin
1905         Result := GetAppDir + CONFIG_DIR_NAME + '\' + CUSTOMBOARD_FILE_NAME;
1906 end;
1907
1908 (*************************************************************************
1909  *\83{\81[\83h\83f\83B\83\8c\83N\83g\83\8a\8eæ\93¾
1910  *************************************************************************)
1911 function TSetting.GetBoardDir: string;
1912 begin
1913         Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_DIR_NAME + '\';
1914 end;
1915
1916 (*************************************************************************
1917  *\83e\83\93\83|\83\89\83\8a\83t\83H\83\8b\83_\81[\96¼\8eæ\93¾
1918  *************************************************************************)
1919 function TSetting.GetHtmlTempFileName: string;
1920 begin
1921         Result := TEMP_FOLDER;
1922 end;
1923
1924
1925 (*************************************************************************
1926  *\8eÀ\8ds\83t\83@\83C\83\8b\83t\83H\83\8b\83_\8eæ\93¾
1927  *************************************************************************)
1928 function TSetting.GetAppDir: string;
1929 begin
1930         Result := ExtractFilePath(Application.ExeName);
1931 end;
1932
1933 (*************************************************************************
1934  *TempHtml\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1935  *************************************************************************)
1936 function TSetting.GetTempFolder: string;
1937 begin
1938         Result := GetAppDir + TEMP_FOLDER;
1939 end;
1940
1941 (*************************************************************************
1942  *sent.ini\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1943  *************************************************************************)
1944 function TSetting.GetSentFileName: string;
1945 begin
1946         Result := GetAppDir + SENT_FILE_NAME;
1947 end;
1948
1949 (*************************************************************************
1950  *outbox.ini\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1951  *************************************************************************)
1952 function TSetting.GetOutBoxFileName: string;
1953 begin
1954         Result := GetAppDir + OUTBOX_FILE_NAME;
1955 end;
1956
1957 (*************************************************************************
1958  *Config\83t\83H\83\8b\83_\8eæ\93¾
1959  *************************************************************************)
1960 function TSetting.GetConfigDir: string;
1961 begin
1962         Result := IncludeTrailingPathDelimiter(GetAppDir + CONFIG_DIR_NAME);
1963 end;
1964
1965 function TSetting.GetStyleSheetDir: string;
1966 begin
1967         Result := IncludeTrailingPathDelimiter(GetConfigDir + CSS_DIR_NAME);
1968 end;
1969
1970 function TSetting.GetSkinDir: string;
1971 begin
1972         Result := IncludeTrailingPathDelimiter(GetConfigDir + SKIN_DIR_NAME);
1973 end;
1974
1975 function TSetting.GetSkinHeaderFileName: string;
1976 begin
1977         Result := CSSFileName + SKIN_HEADER_FILE_NAME;
1978 end;
1979
1980 function TSetting.GetSkinFooterFileName: string;
1981 begin
1982         Result := CSSFileName + SKIN_FOOTER_FILE_NAME;
1983 end;
1984
1985 function TSetting.GetSkinNewResFileName: string;
1986 begin
1987         Result := CSSFileName + SKIN_NEWRES_FILE_NAME;
1988 end;
1989
1990 function TSetting.GetSkinResFileName: string;
1991 begin
1992         Result := CSSFileName + SKIN_RES_FILE_NAME;
1993 end;
1994
1995 function TSetting.GetSkinBookmarkFileName: string;
1996 begin
1997         Result := CSSFileName + SKIN_BOOKMARK_FILE_NAME;
1998 end;
1999
2000 function TSetting.GetSkinNewmarkFileName: string;
2001 begin
2002         Result := CSSFileName + SKIN_NEWMARK_FILE_NAME;
2003 end;
2004
2005 function TSetting.GetNGWordsDir: string;
2006 begin
2007         Result := IncludeTrailingPathDelimiter(GetConfigDir + NGWORDs_DIR_NAME);
2008 end;
2009
2010 function TSetting.GetBoardPlugInDir: string;
2011 begin
2012         Result := IncludeTrailingPathDelimiter(GetConfigDir + BOARD_PLUGIN_DIR_NAME);
2013 end;
2014
2015 procedure TSetting.SetUseCSS( value: Boolean );
2016 begin
2017
2018         FUseCSS := value;
2019
2020         FUseSkin :=
2021                 UseCSS and
2022                 (Pos( GetSkinDir, CSSFileName ) > 0) and
2023                 FileExists( GetSkinHeaderFileName );
2024
2025 end;
2026
2027 procedure TSetting.SetCSSFileName( fileName: string );
2028 begin
2029
2030         FCSSFileName := fileName;
2031
2032         FUseSkin :=
2033                 UseCSS and
2034                 (Pos( GetSkinDir, CSSFileName ) > 0) and
2035                 FileExists( GetSkinHeaderFileName );
2036
2037 end;
2038
2039 function TSetting.GetSambaFileName: string;
2040 begin
2041         Result := GetAppDir + SAMBATIME_FILE_NAME;
2042 end;
2043 //\94Â\8dX\90V\8f\9c\8aO\83J\83e\83S\83\8a\83\8a\83X\83g\95Û\91\83t\83@\83C\83\8b
2044 function TSetting.GetIgnoreFileName: string;
2045 begin
2046         Result := GetConfigDir + IGNORE_FILE_NAME;
2047 end;
2048
2049 //! \83}\83E\83X\83W\83F\83X\83`\83\83\81[\83t\83@\83C\83\8b\83p\83X
2050 function TSetting.GetGestureFileName: string;
2051 begin
2052         Result := GetConfigDir + GESTURE_FILE_NAME;
2053 end;
2054
2055 //! \83X\83p\83\80\83t\83B\83\8b\83^\8aw\8fK\97\9a\97ð\83t\83@\83C\83\8b\83p\83X
2056 function TSetting.GetSpamFilterFileName: string;
2057 begin
2058         Result := GetConfigDir + SPAMFILTER_FILE_NAME;
2059 end;
2060
2061 end.
2062
2063