GME  13
Preference.h
Go to the documentation of this file.
00001 // Preference.h: interface for the CPreference class.
00002 //
00004 
00005 #if !defined(AFX_PREFERENCE_H__5A93281C_8818_4B0A_A6BC_DE727350321B__INCLUDED_)
00006 #define AFX_PREFERENCE_H__5A93281C_8818_4B0A_A6BC_DE727350321B__INCLUDED_
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 #include "ItemData.h"
00013 
00014 
00015 #define PREF_CONNECTION         0x01
00016 #define PREF_ATOM                       0x02
00017 #define PREF_MODEL                      0x04
00018 #define PREF_PROXY                      0x08
00019 #define PREF_SET                        0x10
00020 
00021 
00022 typedef TCHAR*(*TableRowType)[5];
00023 
00024 class CPreference
00025 {
00026         static TCHAR* m_szConnectionPreferenceTable[][5];
00027         static TCHAR* m_szAtomPreferenceTable[][5];
00028         static TCHAR* m_szModelPreferenceTable[][5];
00029         static TCHAR* m_szProxyPreferenceTable[][5];
00030         static TCHAR* m_szSetPreferenceTable[][5];
00031 
00032 public:
00033         void WriteItemToMga(CListItem ListItem, const CMgaFCOPtrList& MgaFCOPtrList, bool bIsForKind);
00034         void IssuePossiblePathConversion(CListItem ListItem, const CMgaFCOPtrList& MgaFCOPtrList, CObjectInspectorCtrl* pParent);
00035 //      CString m_strName;
00036         void CreateListItem(CArray<CListItem,CListItem&>&  ListItems, 
00037                                                 TableRowType, const CString& strValue, 
00038                                                 bool bSameValueForAll, bool bIsDefault,
00039                                                 bool bIsMultiple,const CComPtr<IMgaFCO>&ccpMgaFCO, POSITION nKey);
00040         void GetDefaultValue(CString strCurrPath,objtype_enum oeType, CString& strDefValue);
00041         int FindRegPathInSetTable(const CString& strPath);
00042         int FindRegPathInProxyTable(const CString& strPath);
00043         int FindRegPathInModelTable(const CString& strPath);
00044         int FindRegPathInAtomTable(const CString& strPath);
00045         int FindRegPathInConnectionTable(const CString& strPath);
00046         void SetupPreferences(BYTE cFlags);
00047         static TCHAR* m_szLineStyleList[];
00048         static TCHAR* m_szLineTypeList[];
00049         static TCHAR* m_szBooleanList[];
00050         
00051         CArray<CListItem,CListItem&> m_ListItemArray;
00052         void CreateList( const CMgaFCOPtrList& MgaFCOPtrList);
00053         void Write2Mga(const CString& strValue,const CComPtr<IMgaFCO>& ccpMgaFCO,const CListItem& ListItem, const CString& strRegPath, bool bIsForKind);
00054         
00055         CStringList m_strRegPathList;
00056         CPreference();
00057         virtual ~CPreference();
00058 
00059 private:
00060         // Helper array length variables
00061         int nConnTableLength;
00062         int nAtomTableLength; 
00063         int nModelTableLength;
00064         int nProxyTableLength;
00065         int nSetTableLength;
00066 
00067         // Helper for System Backround Color
00068         TCHAR m_szSysBckGrnd[9];
00069 
00070         // Helper variable for placing auto router switch settings in case of model preferences
00071         bool isAutRouterPrefsCategoryAdded;
00072 
00073         int GetRegistryValue(CComPtr<IMgaFCO>&ccpMgaFCO,CString strPath, CString &strRegValue);
00074         TableRowType GetTableRow(CString strCurrPath, objtype_enum oeType);
00075         
00076         void SetCategories( const CString& strPath, bool bIsAfter);
00077         void ListValue2MgaValue(const CListItem& ListItem, CString& strValue);
00078 };
00079 
00080 
00081 
00082 
00083 #endif // !defined(AFX_PREFERENCE_H__5A93281C_8818_4B0A_A6BC_DE727350321B__INCLUDED_)
00084