Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Settings.h

Go to the documentation of this file.
00001 //
00002 // Settings.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #pragma once
00023 
00024 class CSettingsItem;
00025 
00026 class CSettings  
00027 {
00028 // Construction
00029 public:
00030         CSettings();
00031         virtual ~CSettings();
00032         
00033 // Attributes
00034 public:
00035         struct sGeneral
00036         {
00037                 CString         Path;                                           // Installation path for Shareaza
00038                 CString         UserPath;                                       // Path for user data. (May be the same as above for single user installs)
00039                 BOOL            Debug;                                          // Display debug information
00040                 BOOL            DebugLog;                                       // Create a log file
00041                 DWORD           MaxDebugLogSize;                        // Max size of the log file
00042                 BOOL            UpdateCheck;                            // Does Shareaza check for new versions?
00043                 DWORD           DiskSpaceWarning;                       // Value at which to warn the user about low disk space
00044                 DWORD           DiskSpaceStop;                          // Value at which to pause all downloads due to low disk space
00045                 DWORD           MinTransfersRest;                       // For how long at least to suspend Transfers each round
00046                 INT                     GUIMode;
00047                 BOOL            CloseMode;
00048                 BOOL            TrayMinimise;
00049                 BOOL            VerboseMode;
00050                 BOOL            ShowTimestamp;
00051                 BOOL            SizeLists;
00052                 BOOL            HashIntegrity;
00053                 BOOL            RatesInBytes;
00054                 DWORD           RatesUnit;
00055                 BOOL            AlwaysOpenURLs;
00056                 CString         Language;
00057                 BOOL            IgnoreXPsp2;                            // Ignore the presence of Windows XPsp2 limits
00058         } General;
00059 
00060         struct sInterface
00061         {
00062                 DWORD           TipDelay;
00063                 DWORD           TipAlpha;
00064                 BOOL            TipSearch;
00065                 BOOL            TipLibrary;
00066                 BOOL            TipDownloads;
00067                 BOOL            TipUploads;
00068                 BOOL            TipNeighbours;
00069                 BOOL            TipMedia;
00070                 BOOL            LowResMode;
00071         } Interface;
00072         
00073         struct sLibrary
00074         {
00075                 BOOL            WatchFolders;
00076                 BOOL            PartialMatch;
00077                 BOOL            VirtualFiles;
00078                 BOOL            SourceMesh;
00079                 DWORD           SourceExpire;
00080                 DWORD           TigerHeight;
00081                 DWORD           QueryRouteSize;
00082                 DWORD           HistoryTotal;
00083                 DWORD           HistoryDays;
00084 
00085                 BOOL            ShowVirtual;
00086                 DWORD           TreeSize;
00087                 DWORD           PanelSize;
00088                 BOOL            ShowPanel;
00089                 BOOL            StoreViews;
00090                 BOOL            ShowCoverArt;
00091                 CString         SchemaURI;
00092                 CString         FilterURI;
00093                 CString         SafeExecute;
00094                 CString         PrivateTypes;
00095                 DWORD           ThumbSize;
00096                 CString         BitziWebView;
00097                 CString         BitziWebSubmit;
00098                 CString         BitziXML;
00099                 BOOL            BitziOkay;
00100                 BOOL            HighPriorityHash;                       // Use high priority hashing
00101                 BOOL            HashWindow;                                     // Display annoying hashing window
00102 
00103                 //Not used at the moment
00104                 DWORD           BufferSize;                                     // I/O buffer for hash operation in MB, ignored if Parallel = 1; 0 use 1/4 of phys ram
00105                                                                                                 // if buffer allocation fails hashing will run with Parallel = 1
00106                 DWORD           Parallel;                                       // how many files to hash parallel: 1..6; 0 for autoselect
00107                 int                     LowPriorityHashing;                     // desired speed in MB/s when hashing with low priority
00108         } Library;
00109 
00110         struct sSearch
00111         {
00112                 CString         LastSchemaURI;
00113                 CString         BlankSchemaURI;
00114                 BOOL            HideSearchPanel;
00115                 BOOL            SearchPanel;
00116                 BOOL            ExpandMatches;
00117                 BOOL            HighlightNew;
00118                 BOOL            SwitchToTransfers;
00119                 BOOL            SchemaTypes;
00120                 BOOL            ShowNames;
00121                 DWORD           FilterMask;
00122                 CString         MonitorSchemaURI;
00123                 CString         MonitorFilter;
00124                 DWORD           MonitorQueue;
00125                 DWORD           BrowseTreeSize;
00126                 BOOL            DetailPanelVisible;
00127                 DWORD           DetailPanelSize;
00128                 DWORD           MaxPreviewLength;
00129                 BOOL            AdultFilter;
00130                 BOOL            AdvancedPanel;
00131                 DWORD           GeneralThrottle;                        // A general throttle for how often each indidivual search may run. Low values may cause source finding to get overlooked. 
00132         } Search;
00133         
00134         struct sMediaPlayer
00135         {
00136                 BOOL            EnablePlay;
00137                 BOOL            EnableEnqueue;
00138                 CString         FileTypes;
00139                 BOOL            Repeat;
00140                 BOOL            Random;
00141                 MediaZoom       Zoom;
00142                 double          Aspect;
00143                 double          Volume;
00144                 BOOL            ListVisible;
00145                 DWORD           ListSize;
00146                 BOOL            StatusVisible;
00147                 CString         VisCLSID;
00148                 CString         VisPath;
00149                 INT                     VisSize;
00150         } MediaPlayer;
00151         
00152         struct sWeb
00153         {
00154                 BOOL            Magnet;
00155                 BOOL            Gnutella;
00156                 BOOL            ED2K;
00157                 BOOL            Piolet;
00158                 BOOL            Torrent;
00159         } Web;
00160         
00161         struct sConnection
00162         {
00163                 BOOL            AutoConnect;
00164                 int                     FirewallStatus;
00165                 CString         OutHost;
00166                 CString         InHost;
00167                 DWORD           InPort;
00168                 BOOL            InBind;
00169                 DWORD           InSpeed;
00170                 DWORD           OutSpeed;
00171                 BOOL            IgnoreLocalIP;                          // Ingnore all 'local' (LAN) IPs
00172                 BOOL            IgnoreOwnIP;                            // Do not accept any ports on your external IP as a source
00173                 DWORD           TimeoutConnect;
00174                 DWORD           TimeoutHandshake;
00175                 DWORD           TimeoutTraffic;
00176                 DWORD           SendBuffer;
00177                 BOOL            RequireForTransfers;            // Only upload/download to connected networks
00178                 BOOL            AsyncIO;
00179                 DWORD           ConnectThrottle;                        // Delay between connection attempts. (Neighbour connections)
00180                 BOOL            DetectConnectionLoss;           // Detect loss of internet connection
00181                 BOOL            DetectConnectionReset;          // Detect regaining of internet connection
00182                 BOOL            ForceConnectedState;            // Force WinINet into a connected state on startup. (Put IE into online mode)
00183                 BOOL            SlowConnect;                            // Connect to one network at a time. Don't download while connecting. (XPsp2)
00184         } Connection;
00185 
00186         struct sBandwidth
00187         {
00188                 DWORD           Request;
00189                 DWORD           HubIn;
00190                 DWORD           HubOut;
00191                 DWORD           LeafIn;
00192                 DWORD           LeafOut;
00193                 DWORD           PeerIn;
00194                 DWORD           PeerOut;
00195                 DWORD           UdpOut;
00196                 DWORD           Downloads;
00197                 DWORD           Uploads;
00198                 DWORD           HubUploads;
00199         } Bandwidth;
00200 
00201         struct sCommunity
00202         {
00203                 BOOL            ChatEnable;                                     // Is chat enabled with compatible clients?
00204                 BOOL            ChatAllNetworks;                        // Is chat allowed over other protocols? (ed2k, etc)
00205                 BOOL            ChatFilter;                                     // Filter out chat spam
00206                 BOOL            ChatFilterED2K;                         // Filter known ed2k spam. (pretty bad- always on)
00207                 BOOL            ChatCensor;                                     // Censor 'bad' words from chat. (Uses adult filter)
00208                 BOOL            Timestamp;
00209                 BOOL            ServeProfile;
00210                 BOOL            ServeFiles;
00211         } Community;
00212 
00213         struct sDiscovery
00214         {
00215                 DWORD           AccessThrottle;
00216                 DWORD           Lowpoint;
00217                 DWORD           FailureLimit;
00218                 DWORD           UpdatePeriod;
00219                 DWORD           DefaultUpdate;
00220                 DWORD           BootstrapCount;
00221                 CString         G2DAddress;
00222                 DWORD           G2DRetryAfter;
00223                 int                     CacheCount;                                     // Limit ability to learn new caches
00224         } Discovery;
00225         
00226         struct sGnutella
00227         {
00228                 DWORD           ConnectFactor;
00229                 BOOL            DeflateHub2Hub;
00230                 BOOL            DeflateLeaf2Hub;
00231                 BOOL            DeflateHub2Leaf;
00232                 DWORD           MaxResults;                                     // Maximum results to return to a single query
00233                 DWORD           MaxHits;
00234                 DWORD           HitsPerPacket;
00235                 DWORD           RouteCache;
00236                 DWORD           HostCacheSize;
00237                 DWORD           HostCacheView;
00238                 DWORD           ConnectThrottle;
00239                 BOOL            BlockBlankClients;                      // Block Ultrapeers with no user agent
00240                 BOOL            SpecifyProtocol;                        // Specify G1 or G2 when initiating a connection
00241         } Gnutella;
00242         
00243         struct sGnutella1
00244         {
00245                 DWORD           ClientMode;                                     // Desired mode of operation: MODE_AUTO, MODE_LEAF, MODE_ULTRAPEER
00246                 BOOL            EnableToday;
00247                 BOOL            EnableAlways;
00248                 int                     NumHubs;                                        // Number of ultrapeers a leaf has
00249                 int                     NumLeafs;                                       // Number of leafs an ultrapeer has
00250                 int                     NumPeers;                                       // Number of peers an ultrapeer has
00251                 DWORD           PacketBufferSize;
00252                 DWORD           PacketBufferTime;
00253                 DWORD           DefaultTTL;
00254                 DWORD           SearchTTL;
00255                 DWORD           TranslateTTL;
00256                 DWORD           MaximumTTL;
00257                 DWORD           MaximumPacket;
00258                 DWORD           MaximumQuery;
00259                 BOOL            StrictPackets;
00260                 BOOL            EnableGGEP;
00261                 BOOL            VendorMsg;
00262                 DWORD           QueryThrottle;
00263                 DWORD           RequeryDelay;
00264                 DWORD           HostExpire;
00265                 DWORD           PingFlood;
00266                 DWORD           PingRate;
00267                 DWORD           PongCache;
00268                 int                     PongCount;
00269                 int                     HitQueueLimit;                          // Protect G1 clients from badly configured queues
00270                 BOOL            QueryHitUTF8;                           // Use UTF-8 encoding to read Gnutella1 QueryHit packets
00271                 BOOL            QuerySearchUTF8;                        // Use UTF-8 encoding to create Gnutella1 Query packets
00272         } Gnutella1;
00273 
00274         struct sGnutella2
00275         {
00276                 DWORD           ClientMode;                                     // Desired mode of operation: MODE_AUTO, MODE_LEAF, MODE_HUB
00277                 BOOL            HubVerified;
00278                 BOOL            EnableToday;
00279                 BOOL            EnableAlways;
00280                 int                     NumHubs;                                        // Number of hubs a leaf has
00281                 int                     NumLeafs;                                       // Number of leafs a hub has
00282                 int                     NumPeers;                                       // Number of peers a hub has
00283                 int                     PingRelayLimit;                         // Number of other leafs to forward a /PI/UDP to: 10 - 30
00284                 DWORD           UdpMTU;
00285                 DWORD           UdpBuffers;
00286                 DWORD           UdpInFrames;
00287                 DWORD           UdpOutFrames;
00288                 DWORD           UdpGlobalThrottle;
00289                 DWORD           UdpOutExpire;
00290                 DWORD           UdpOutResend;
00291                 DWORD           UdpInExpire;
00292                 DWORD           KHLPeriod;
00293                 DWORD           KHLHubCount;
00294                 DWORD           HAWPeriod;
00295                 DWORD           HostCurrent;
00296                 DWORD           HostExpire;
00297                 DWORD           QueryGlobalThrottle;            // Max G2 query rate (Cannot exceed 8/sec)
00298                 DWORD           QueryHostThrottle;
00299                 DWORD           QueryHostDeadline;
00300                 DWORD           RequeryDelay;
00301                 DWORD           HubHorizonSize;
00302                 DWORD           QueryLimit;
00303         } Gnutella2;
00304         
00305         struct seDonkey
00306         {
00307                 BOOL            EnableToday;
00308                 BOOL            EnableAlways;
00309                 BOOL            FastConnect;                            // Try connecting to 2 servers to get online faster
00310                 DWORD           NumServers;                                     // 1
00311                 int                     MaxLinks;                                       // Max ed2k client links
00312                 int                     MaxResults;
00313                 DWORD           MaxShareCount;                          // Hard limit on file list sent to server
00314                 BOOL            ServerWalk;                                     // Enable global UDP walk of servers
00315                 DWORD           StatsGlobalThrottle;            // Global throttle for server UDP stats requests
00316                 DWORD           QueryGlobalThrottle;            // Global throttle for all ed2k searches (TCP, UDP, manual and auto)
00317                 DWORD           StatsServerThrottle;            // Max rate at which an individual server can be asked for stats
00318                 DWORD           QueryServerThrottle;            // Max rate at which an individual server can be queried
00319                 DWORD           QueryFileThrottle;                      // Max rate a file can have GetSources done
00320                 DWORD           GetSourcesThrottle;                     // Max rate a general GetSources can done
00321                 DWORD           QueueRankThrottle;                      // How frequently queue ranks are sent
00322                 DWORD           PacketThrottle;                         // ED2K packet rate limiter
00323                 DWORD           SourceThrottle;                         // ED2K source rate limiter
00324                 DWORD           MetAutoQuery;                           // Auto query for a new server list
00325                 BOOL            LearnNewServers;                        // Get new servers from servers
00326                 BOOL            LearnNewServersClient;          // Get new servers from clients
00327                 CString         ServerListURL;
00328                 DWORD           RequestPipe;
00329                 DWORD           RequestSize;
00330                 DWORD           FrameSize;
00331                 DWORD           ReAskTime;
00332                 DWORD           DequeueTime;
00333                 BOOL            ExtendedRequest;
00334                 BOOL            MagnetSearch;                           // Search for magnets over ed2k (lower server load)
00335                 DWORD           MinServerFileSize;                      // Minimum size a file in the library must be in order to be included in the server file list. (In KB)
00336                 BOOL            TagNames;                                       // Add (Shareaza.com) to user name over ed2k
00337                 DWORD           DefaultServerFlags;                     // Default server flags (for UDP searches)
00338                 BOOL            Endgame;                                        // Allow endgame mode when completing downloads. (Download same chunk from multiple sources)
00339         } eDonkey;
00340         
00341         struct sBitTorrent
00342         {
00343                 BOOL            AdvancedInterface;                      // Display BT 'extras' (Seed Torrent box, etc)
00344                 BOOL            AdvancedInterfaceSet;           // Has Shareaza auto-set the above value (first time a user downloads a torrent)
00345                 CString         TorrentCreatorPath;                     // Location of the program used to create .torrent files
00346                 CString         DefaultTracker;
00347                 DWORD           DefaultTrackerPeriod;           // Delay between tracker contact attempts if one is not specified by tracker
00348                 int                     MaxTrackerRetry;                        // Number of times to retry a tracker if it doesn't respond
00349                 int                     TorrentCodePage;                        // The code page to assume for a .torrent file if it isn't UTF-8
00350                 int                     TorrentExtraKeys;                       // Check for '.utf8' keys if there is an encoding error
00351                 BOOL            TorrentIgnoreErrors;            // Ignore encoding errors in torrents
00352                 DWORD           LinkTimeout;
00353                 DWORD           LinkPing;
00354                 DWORD           RequestPipe;
00355                 DWORD           RequestSize;
00356                 DWORD           RequestLimit;
00357                 DWORD           RandomPeriod;
00358                 DWORD           SourceExchangePeriod;
00359                 int                     UploadCount;
00360                 int                     DownloadConnections;            // Number active torrent connections allowed
00361                 int                     DownloadTorrents;                       // Number of torrents to download at once
00362                 BOOL            Endgame;                                        // Allow endgame mode when completing torrents. (Download same chunk from multiple sources)
00363                 BOOL            AutoClear;                                      // Clear completed torrents when they meet the required share ratio
00364                 DWORD           ClearRatio;                                     // Share ratio a torrent must reach to be cleared. (Minimum 100%)
00365                 BOOL            AutoSeed;                                       // Automatically re-seed most recently completed torrent on start-up
00366                 DWORD           BandwidthPercentage;            // Percentage of bandwidth to use when BT active.
00367                 BOOL            TrackerKey;                                     // Send a key (random value) to trackers
00368                 BOOL            StandardPeerID;                         // Use the newer (non-official) standard for making Peer-IDs
00369                 BOOL            PreferenceBTSources;            // Preference downloading from BT sources where appropriate
00370         } BitTorrent;
00371 
00372         struct sDownloads
00373         {
00374                 CString         IncompletePath;                         // Where incomplete downloads are stored
00375                 CString         CompletePath;                           // Where downloads are moved when they complete
00376                 CString         TorrentPath;                            // Where .torrent files are stored
00377                 CString         CollectionPath;                         // Where .collection and .co files are stored
00378                 DWORD           BufferSize;
00379                 DWORD           SparseThreshold;                        // NTFS 'sparse files' are not used on files below this size. (0 = Disable)
00380                 INT                     MaxFiles;                                       // How many files download at once
00381                 INT                     MaxTransfers;                           // How many total tranfers take place
00382                 INT                     MaxFileTransfers;                       // How mnay transfers are allowed per file
00383                 INT                     MaxFileSearches;                        // Number number of files over the download limit that prepare to start. (Search, etc)
00384                 INT                     MaxConnectingSources;           // The maximum number of sources that can be in the 'connecting' state. (Important for XPsp2)
00385                 INT                     MinSources;                                     // The minimum number of sources a download has before Shareaza regards it as having a problem
00386                 DWORD           ConnectThrottle;                        // Delay between download attempts. (Very important for routers)
00387                 INT                     QueueLimit;                                     // Longest queue to wait in. (0 to disable. This should be >800 or 0 to get good performance from ed2k)
00388                 DWORD           SearchPeriod;
00389                 DWORD           StarveTimeout;
00390                 DWORD           StarveGiveUp;                           // How long (in hours) before Shareaza will give up and try another download if it gets no data. (+ 0-9 h, depending on sources)
00391                 DWORD           RetryDelay;
00392                 DWORD           PushTimeout;
00393                 BOOL            StaggardStart;
00394                 BOOL            AllowBackwards;                         // Permit download to run in reverse when appropriate
00395                 DWORD           ChunkSize;
00396                 DWORD           ChunkStrap;
00397                 BOOL            Metadata;
00398                 BOOL            VerifyFiles;
00399                 BOOL            VerifyTiger;
00400                 BOOL            VerifyED2K;
00401                 BOOL            NeverDrop;                                      // Do not drop bad sources (may pollute source list with many dead sources)
00402                 BOOL            RequestHash;
00403                 BOOL            RequestHTTP11;
00404                 BOOL            RequestURLENC;
00405                 DWORD           SaveInterval;
00406                 BOOL            FlushSD;
00407                 BOOL            ShowSources;
00408                 BOOL            SimpleBar;                                      // Displays a simplified progress bar (lower CPU use)
00409                 BOOL            ShowPercent;                            // Display small green % complete bar on progress graphic
00410                 BOOL            ShowGroups;
00411                 BOOL            AutoExpand;
00412                 BOOL            AutoClear;
00413                 DWORD           ClearDelay;
00414                 DWORD           FilterMask;
00415                 BOOL            ShowMonitorURLs;
00416                 BOOL            SortColumns;                            // Allow user to sort downloads by clicking column headers
00417                 BOOL            SortSources;                            // Automatically sort sources (Status, protocol, queue)
00418                 int                     SourcesWanted;                          // Number of sources Shareaza 'wants'. (Will not request more than this number of sources from ed2k/BT)
00419                 int                     MaxReviews;                                     // Maximum number of reviews to store per download
00420         } Downloads;
00421         
00422         struct sUploads
00423         {
00424                 int                     MaxPerHost;                                     // Max simultaneous uploads to one remote client
00425                 DWORD           FreeBandwidthValue;
00426                 DWORD           FreeBandwidthFactor;
00427                 DWORD           ClampdownFactor;
00428                 DWORD           ClampdownFloor;
00429                 BOOL            ThrottleMode;
00430                 DWORD           QueuePollMin;
00431                 DWORD           QueuePollMax;
00432                 DWORD           RotateChunkLimit;
00433                 BOOL            SharePartials;
00434                 BOOL            ShareTiger;
00435                 BOOL            ShareHashset;
00436                 BOOL            ShareMetadata;
00437                 BOOL            SharePreviews;
00438                 BOOL            DynamicPreviews;
00439                 DWORD           PreviewQuality;
00440                 DWORD           PreviewTransfers;
00441                 BOOL            AllowBackwards;                         // Allow data to be sent from end of range to begining where supported
00442                 BOOL            HubUnshare;
00443                 CString         BlockAgents;
00444                 BOOL            AutoClear;                                      // Automatically clear completed uploads ('Completed' queue)
00445                 DWORD           ClearDelay;                                     // Delay between auto-clears
00446                 DWORD           FilterMask;
00447                 int             RewardQueuePercentage;          // The percentage of each reward queue reserved for uploaders
00448         } Uploads;
00449         
00450         struct sRemote
00451         {
00452                 BOOL            Enable;
00453                 CString         Username;
00454                 CString         Password;
00455         } Remote;
00456 
00457         struct sScheduler
00458         {
00459                 BOOL            Enable;                                         // Enable the scheduler
00460                 DWORD           LimitedBandwidth;                       // % of bandwidth to use in limited mode
00461                 BOOL            LimitedNetworks;                        // Only connect to G2/BT when limited
00462                 BOOL            AllowHub;                                       // Allow hub mode while scheduler is active
00463         } Scheduler;
00464         
00465         struct sLive
00466         {
00467                 BOOL            DiskSpaceWarning;                       // Has the user been warned of low disk space?
00468                 BOOL            DiskWriteWarning;                       // Has the user been warned of write problems?
00469                 BOOL            AdultWarning;                           // Has the user been warned about the adult filter?
00470                 BOOL            QueueLimitWarning;                      // Has the user been warned about limiting the max Q position accepted?
00471                 BOOL            DonkeyServerWarning;            // Has the user been warned about having an empty server list?
00472                 BOOL            UploadLimitWarning;                     // Has the user been warned about the ed2k/BT ratio?
00473                 BOOL            DiskSpaceStop;                          // Has Shareaza paused all downloads due to critical disk space?
00474                 DWORD           BandwidthScale;                         // Monitor slider settings
00475                 BOOL            LoadWindowState;
00476                 BOOL            AutoClose;
00477                 BOOL            FirstRun;                                       // Is this the first time Shareaza is being run?
00478         } Live;
00479 
00480 // Attributes : Item List
00481 protected:
00482         CPtrList        m_pItems;
00483 public:
00484         class Item
00485         {
00486         public:
00487                 Item(LPCTSTR pszName, DWORD* pDword, DOUBLE* pFloat, CString* pString);
00488                 void    Load();
00489                 void    Save();
00490         public:
00491                 CString         m_sName;
00492                 DWORD*          m_pDword;
00493                 DOUBLE*         m_pFloat;
00494                 CString*        m_pString;
00495         };
00496 
00497 // Operations
00498 public:
00499         void    Load();
00500         void    Save(BOOL bShutdown = FALSE);
00501         Item*   GetSetting(LPCTSTR pszName) const;
00502         Item*   GetSetting(LPVOID pValue) const;
00503 public:
00504         BOOL    LoadWindow(LPCTSTR pszName, CWnd* pWindow);
00505         void    SaveWindow(LPCTSTR pszName, CWnd* pWindow);
00506         BOOL    LoadList(LPCTSTR pszName, CListCtrl* pCtrl, int nSort = 0);
00507         void    SaveList(LPCTSTR pszName, CListCtrl* pCtrl);
00508         CString SmartAgent();
00509         CString SmartVolume(QWORD nVolume, BOOL bInKB, BOOL bRateInBits = FALSE, BOOL bTruncate = FALSE );
00510         QWORD   ParseVolume(LPCTSTR psz, BOOL bSpeedInBits);
00511         DWORD   GetOutgoingBandwidth();                                         //Returns available outgoing bandwidth in KB/s
00512         BOOL    CheckStartup();
00513         void    SetStartup(BOOL bStartup);
00514 protected:
00515         void    Setup();
00516         void    Add(LPCTSTR pszName, DWORD* pDword, DWORD nDefault);
00517         void    Add(LPCTSTR pszName, int* pDword, DWORD nDefault);
00518         void    Add(LPCTSTR pszName, DOUBLE* pFloat, DOUBLE nDefault);
00519         void    Add(LPCTSTR pszName, CString* pString, LPCTSTR pszDefault);
00520         void    SmartUpgrade();
00521 };
00522 
00523 extern CSettings Settings;
00524 
00525 enum
00526 {
00527         GUI_WINDOWED, GUI_TABBED, GUI_BASIC
00528 };
00529 
00530 enum
00531 {
00532         MODE_AUTO, MODE_LEAF, MODE_HUB, MODE_ULTRAPEER = MODE_HUB
00533 };
00534 
00535 enum
00536 {
00537         CONNECTION_FIREWALLED, CONNECTION_OPEN, CONNECTION_AUTO
00538 };
00539 
00540 #define GNUTELLA_DEFAULT_PORT   6346
00541 #define ED2K_DEFAULT_PORT               4661

Generated on Thu Dec 15 10:39:48 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2