2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Supports registration of UI Lib modules.
20 #ifndef CDOWNLOADMGRUILIBREGISTRY_H
21 #define CDOWNLOADMGRUILIBREGISTRY_H
27 // FORWARD DECLARATIONS
28 class CDownloadMgrUiUserInteractions;
29 class CDownloadMgrUiDownloadsList;
30 class RHttpDownloadMgr;
32 class CUiLibRegistryExtension;
37 * This abstarct class represents an accessor for the resources of the UI Lib Registry.
39 NONSHARABLE_CLASS( MDownloadMgrUiLibRegModel )
44 * Third UID of the Client App, which installed UI Lib.
45 * This is the UID with which RHttpDownloadMgr was connected.
47 virtual TUid ClientAppUid() const = 0;
50 * Is Downloads List installed?
52 virtual TBool DownloadsListInstalled() const = 0;
55 * Reference to the Downloads List.
57 virtual CDownloadMgrUiDownloadsList& DownloadsList() const = 0;
60 * Is User Interactions installed?
62 virtual TBool UserInteractionsInstalled() const = 0;
65 * Reference to the User Interactions.
67 virtual CDownloadMgrUiUserInteractions& UserInteractions() const = 0;
70 * Reference to the observed DMgr session.
72 virtual RHttpDownloadMgr& DownloadMgr() const = 0;
75 * All download in Download Manager session.
77 virtual TInt DownloadCount() const = 0;
82 * Supports registration of a User Interactions and a Downloads List component.
84 NONSHARABLE_CLASS( CDownloadMgrUiLibRegistry ) : public CBase,
85 public MDownloadMgrUiLibRegModel
87 public: // Constructors and destructor
90 * Two-phased constructor.
91 * @param aDownloadMgr The initial Download Manager session
93 IMPORT_C static CDownloadMgrUiLibRegistry* NewL( RHttpDownloadMgr& aDownloadMgr );
98 IMPORT_C virtual ~CDownloadMgrUiLibRegistry();
100 public: // New functions
102 // ******* Register User Interactions and Downloads List
105 * Register a User Interactions.
106 * The created component will be owned by the Registry.
107 * @return Reference to the constructed object.
109 IMPORT_C CDownloadMgrUiUserInteractions& RegisterUserInteractionsL();
112 * Register a Downloads List.
113 * The created component will be owned by the Registry.
114 * @return Reference to the constructed object.
116 IMPORT_C CDownloadMgrUiDownloadsList& RegisterDownloadsListL();
118 public: // Functions from MDownloadMgrUiLibRegModel
120 virtual TUid ClientAppUid() const;
121 virtual TBool DownloadsListInstalled() const;
122 virtual CDownloadMgrUiDownloadsList& DownloadsList() const;
123 virtual TBool UserInteractionsInstalled() const;
124 virtual CDownloadMgrUiUserInteractions& UserInteractions() const;
125 virtual RHttpDownloadMgr& DownloadMgr() const;
126 virtual TInt DownloadCount() const;
128 private: // Constructors
131 * C++ default constructor.
133 CDownloadMgrUiLibRegistry( RHttpDownloadMgr& aDownloadMgr );
136 * By default Symbian 2nd phase constructor is private.
140 private: // New functions
143 * Set registered UI components as observers of iDownloadMgr.
145 void SetUiComponentsAsObserversL();
148 * Remove registered UI components as observers from iDownloadMgr.
150 void RemoveUiComponentsAsObservers();
154 CUiLibRegistryExtension* iExtension; ///< Extension class. Owned.
157 CDownloadMgrUiUserInteractions* iUserInteractions; // Owned.
158 CDownloadMgrUiDownloadsList* iDownloadsList; // Owned.
160 // Observed DM session
161 RHttpDownloadMgr& iDownloadMgr; ///< Observed.
165 #endif /* CDOWNLOADMGRUILIBREGISTRY_H */