Artifact Content

Not logged in

Artifact e17b66ef630a3999955407c740d874f1ab53caa0


     1  // NoahCM.h
     2  //-- CNoahConfigManager -- save / load / modify the setting of 'Noah' --
     3  
     4  #ifndef AFX_NOAHCM_H__ACE475C1_D925_4F9E_BDCA_783B921E6FD5__INCLUDED_
     5  #define AFX_NOAHCM_H__ACE475C1_D925_4F9E_BDCA_783B921E6FD5__INCLUDED_
     6  
     7  class CNoahConfigManager;
     8  
     9  class CNoahConfigDialog : public kiPropSheet
    10  {
    11  public:
    12  	class CCmprPage : public kiPropSheetPage
    13  	{
    14  	public:
    15  		CCmprPage();
    16  	private:
    17  		BOOL onInit();
    18  		bool onOK();
    19  		bool onCancel();
    20  		BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp );
    21  		void correct( const char* ext, bool first );
    22  		void SetUpToolTip();
    23  	private:
    24  		HWND m_tooltip;
    25  	};
    26  	class CMeltPage : public kiPropSheetPage
    27  	{
    28  	public:
    29  		CMeltPage();
    30  	private:
    31  		BOOL onInit();
    32  		bool onOK();
    33  		BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp );
    34  		void correct();
    35  	};
    36  	class CWinXPage : public kiPropSheetPage
    37  	{
    38  	public:
    39  		CWinXPage();
    40  	private:
    41  		BOOL onInit();
    42  		BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp );
    43  		bool onOK();
    44  	};
    45  	class CAssPage : public kiDialog
    46  	{
    47  	public:
    48  		CAssPage( HWND parent );
    49  	private:
    50  		BOOL onInit();
    51  		BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp );
    52  		bool onOK();
    53  	};
    54  	class CInfoPage : public kiPropSheetPage
    55  	{
    56  	public:
    57  		CInfoPage();
    58  	private:
    59  		BOOL onInit();
    60  	};
    61  
    62  public:
    63  	CNoahConfigDialog();
    64  
    65  private:
    66  	bool onOK();
    67  	bool onCancel();
    68  	void onApply();
    69  	void onHelp();
    70  	void onCommand( UINT id );
    71  	BOOL onInit();
    72  	void onDrop( HDROP hdrop );
    73  	static void shift_and_button();
    74  };
    75  
    76  enum loading_flag
    77  {
    78  	Mode    = 1,
    79  	Melt    = 2,
    80  	Compress= 4,
    81  	Shell   = 8,
    82  	OpenDir =16,
    83  	All     =31,
    84  };
    85  
    86  class CNoahConfigManager
    87  {
    88  public: //-- 操作
    89  
    90  	void init();
    91  	void load( loading_flag what );
    92  	void save();
    93  	void dialog();
    94  
    95  public: //-- 設定項目取得用インターフェイス
    96  
    97  	// Section: Mode
    98  	const int     mode()  { return m_Mode; }  // 0:圧専 1:圧優 2:解優 3:解専
    99  	const bool  miniboot(){ return m_MiniBoot; } // 最小化起動?
   100  	const bool  oldver()  { return m_OldVer; }// 古い形式でバージョン表示
   101  	const int   extnum()  { return m_OneExt ? 1 : m_ZeroExt ? 0 : -1; } // 書庫名作成時に拡張子と見なす部分
   102  	const int multiboot_limit() { return m_MbLim; } // 多重起動個数制限値
   103  	// Section: Melt
   104  	const kiPath& mdir()  { return m_MDir; }  // 解凍先
   105  	const bool    mdirsm(){ return m_MDirSm; }// 同じディレクトリに解凍?
   106  	const int     mkdir() { return m_MkDir; } // 0:x 1:file 2:dir 3:o
   107  	const bool    mnonum(){ return m_MNoNum; }// 数字省略
   108  	const char*   kill()  { return m_Kill; }// OFFにする内蔵ルーチン
   109  	// Section: Compress
   110  	const kiPath& cdir()  { return m_CDir; }  // 圧縮先
   111  	const bool    cdirsm(){ return m_CDirSm; }// 同じディレクトリに圧縮?
   112  	const kiStr&  cext()  { return m_CExt; }  // 圧縮形式
   113  	const kiStr&  cmhd()  { return m_CMhd; }  // 圧縮メソッド
   114  	// Section: Shell
   115  	// Section: OpenDir
   116  	const bool    modir() { return m_MODir; } // 解凍後開く?
   117  	const bool    codir() { return m_CODir; } // 圧縮後開く?
   118  	const kiStr&  openby(){ return m_OpenBy; }// 開くプログラム(隠し)
   119  
   120  private: //-- 内部変数
   121  
   122  	unsigned long m_Loaded;
   123  	kiIniFile m_Ini;
   124  	kiStr m_UserName;
   125  	HINSTANCE m_hNoahXtDLL;
   126  	enum { NOSHL, NOADMIN, SHLOK } m_bShlOK;
   127  
   128  	// 設定項目
   129  	int    m_Mode;
   130  	kiPath m_MDir, m_CDir;
   131  	bool   m_MODir,m_CODir,m_MDirSm,m_CDirSm;
   132  	int    m_MkDir;
   133  	int    m_MbLim;
   134  	kiStr  m_CExt;
   135  	kiStr  m_OpenBy;
   136  	kiStr  m_CMhd;
   137  	bool   m_MNoNum;
   138  	bool   m_SCSendTo,m_SCDesktop;
   139  	kiStr  m_Kill;
   140  	bool   m_SECmp, m_SEExt, m_bAsso[13];
   141  	bool   m_MiniBoot;
   142  	bool   m_OldVer;
   143  	bool   m_OneExt, m_ZeroExt;
   144  
   145  	// 関数ロード
   146  	FARPROC getProc( const char* name );
   147  
   148  public:
   149  	CNoahConfigManager()
   150  		{
   151  			m_hNoahXtDLL = NULL;
   152  		}
   153  	~CNoahConfigManager()
   154  		{
   155  			if( m_hNoahXtDLL )
   156  				::FreeLibrary( m_hNoahXtDLL );
   157  		}
   158  friend class CNoahConfigDialog::CCmprPage;
   159  friend class CNoahConfigDialog::CMeltPage;
   160  friend class CNoahConfigDialog::CWinXPage;
   161  friend class CNoahConfigDialog::CInfoPage;
   162  friend class CNoahConfigDialog::CAssPage;
   163  };
   164  
   165  #endif