epoc32/include/mw/cdownloadmgruilibregistry.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Supports registration of UI Lib modules.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef CDOWNLOADMGRUILIBREGISTRY_H
williamr@2
    21
#define CDOWNLOADMGRUILIBREGISTRY_H
williamr@2
    22
williamr@2
    23
//  INCLUDES
williamr@2
    24
#include <e32std.H>
williamr@2
    25
#include <e32base.h>
williamr@2
    26
williamr@2
    27
// FORWARD DECLARATIONS
williamr@2
    28
class CDownloadMgrUiUserInteractions;
williamr@2
    29
class CDownloadMgrUiDownloadsList;
williamr@2
    30
class RHttpDownloadMgr;
williamr@2
    31
class RHttpDownload;
williamr@2
    32
class CUiLibRegistryExtension;
williamr@2
    33
williamr@2
    34
// CLASS DECLARATION
williamr@2
    35
williamr@2
    36
/**
williamr@2
    37
*  This abstarct class represents an accessor for the resources of the UI Lib Registry.
williamr@2
    38
*/
williamr@2
    39
NONSHARABLE_CLASS( MDownloadMgrUiLibRegModel )
williamr@2
    40
    {
williamr@2
    41
    public:
williamr@2
    42
williamr@2
    43
        /**
williamr@2
    44
        * Third UID of the Client App, which installed UI Lib.
williamr@2
    45
        * This is the UID with which RHttpDownloadMgr was connected.
williamr@2
    46
        */
williamr@2
    47
        virtual TUid ClientAppUid() const = 0;
williamr@2
    48
williamr@2
    49
        /**
williamr@2
    50
        * Is Downloads List installed?
williamr@2
    51
        */
williamr@2
    52
        virtual TBool DownloadsListInstalled() const = 0;
williamr@2
    53
williamr@2
    54
        /**
williamr@2
    55
        * Reference to the Downloads List.
williamr@2
    56
        */
williamr@2
    57
        virtual CDownloadMgrUiDownloadsList& DownloadsList() const = 0;
williamr@2
    58
williamr@2
    59
        /**
williamr@2
    60
        * Is User Interactions installed?
williamr@2
    61
        */
williamr@2
    62
        virtual TBool UserInteractionsInstalled() const = 0;
williamr@2
    63
williamr@2
    64
        /**
williamr@2
    65
        * Reference to the User Interactions.
williamr@2
    66
        */
williamr@2
    67
        virtual CDownloadMgrUiUserInteractions& UserInteractions() const = 0;
williamr@2
    68
williamr@2
    69
        /**
williamr@2
    70
        * Reference to the observed DMgr session.
williamr@2
    71
        */
williamr@2
    72
        virtual RHttpDownloadMgr& DownloadMgr() const = 0;
williamr@2
    73
williamr@2
    74
        /**
williamr@2
    75
        * All download in Download Manager session.
williamr@2
    76
        */
williamr@2
    77
        virtual TInt DownloadCount() const = 0;
williamr@2
    78
williamr@2
    79
    };
williamr@2
    80
williamr@2
    81
/**
williamr@2
    82
*  Supports registration of a User Interactions and a Downloads List component.
williamr@2
    83
*/
williamr@2
    84
NONSHARABLE_CLASS( CDownloadMgrUiLibRegistry ) : public CBase,
williamr@2
    85
                                                 public MDownloadMgrUiLibRegModel
williamr@2
    86
    {
williamr@2
    87
    public:  // Constructors and destructor
williamr@2
    88
        
williamr@2
    89
        /**
williamr@2
    90
        * Two-phased constructor.
williamr@2
    91
        * @param aDownloadMgr The initial Download Manager session
williamr@2
    92
        */
williamr@2
    93
        IMPORT_C static CDownloadMgrUiLibRegistry* NewL( RHttpDownloadMgr& aDownloadMgr );
williamr@2
    94
        
williamr@2
    95
        /**
williamr@2
    96
        * Destructor.
williamr@2
    97
        */
williamr@2
    98
        IMPORT_C virtual ~CDownloadMgrUiLibRegistry();
williamr@2
    99
williamr@2
   100
    public: // New functions
williamr@2
   101
williamr@2
   102
        // ******* Register User Interactions and Downloads List
williamr@2
   103
williamr@2
   104
        /**
williamr@2
   105
        * Register a User Interactions.
williamr@2
   106
        * The created component will be owned by the Registry.
williamr@2
   107
        * @return Reference to the constructed object.
williamr@2
   108
        */
williamr@2
   109
        IMPORT_C CDownloadMgrUiUserInteractions& RegisterUserInteractionsL();
williamr@2
   110
williamr@2
   111
        /**
williamr@2
   112
        * Register a Downloads List.
williamr@2
   113
        * The created component will be owned by the Registry.
williamr@2
   114
        * @return Reference to the constructed object.
williamr@2
   115
        */
williamr@2
   116
        IMPORT_C CDownloadMgrUiDownloadsList& RegisterDownloadsListL();
williamr@2
   117
williamr@2
   118
    public: // Functions from MDownloadMgrUiLibRegModel
williamr@2
   119
williamr@2
   120
        virtual TUid ClientAppUid() const;
williamr@2
   121
        virtual TBool DownloadsListInstalled() const;
williamr@2
   122
        virtual CDownloadMgrUiDownloadsList& DownloadsList() const;
williamr@2
   123
        virtual TBool UserInteractionsInstalled() const;
williamr@2
   124
        virtual CDownloadMgrUiUserInteractions& UserInteractions() const;
williamr@2
   125
        virtual RHttpDownloadMgr& DownloadMgr() const;
williamr@2
   126
        virtual TInt DownloadCount() const;
williamr@2
   127
williamr@2
   128
    private: // Constructors
williamr@2
   129
williamr@2
   130
        /**
williamr@2
   131
        * C++ default constructor.
williamr@2
   132
        */
williamr@2
   133
        CDownloadMgrUiLibRegistry( RHttpDownloadMgr& aDownloadMgr );
williamr@2
   134
williamr@2
   135
        /**
williamr@2
   136
        * By default Symbian 2nd phase constructor is private.
williamr@2
   137
        */
williamr@2
   138
        void ConstructL();
williamr@2
   139
williamr@2
   140
    private: // New functions
williamr@2
   141
williamr@2
   142
        /**
williamr@2
   143
        * Set registered UI components as observers of iDownloadMgr.
williamr@2
   144
        */
williamr@2
   145
        void SetUiComponentsAsObserversL();
williamr@2
   146
williamr@2
   147
        /**
williamr@2
   148
        * Remove registered UI components as observers from iDownloadMgr.
williamr@2
   149
        */
williamr@2
   150
        void RemoveUiComponentsAsObservers();
williamr@2
   151
williamr@2
   152
    private: // Data
williamr@2
   153
williamr@2
   154
        CUiLibRegistryExtension* iExtension; ///< Extension class. Owned.
williamr@2
   155
williamr@2
   156
        // UI components
williamr@2
   157
        CDownloadMgrUiUserInteractions* iUserInteractions; // Owned.
williamr@2
   158
        CDownloadMgrUiDownloadsList*    iDownloadsList; // Owned.
williamr@2
   159
williamr@2
   160
        // Observed DM session
williamr@2
   161
        RHttpDownloadMgr& iDownloadMgr; ///< Observed.
williamr@2
   162
        TUid iClientAppUid;
williamr@2
   163
    };
williamr@2
   164
williamr@2
   165
#endif /* CDOWNLOADMGRUILIBREGISTRY_H */