photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxuploadcenrepwatcher.h
author Simon Howkins <simonh@symbian.org>
Mon, 29 Nov 2010 11:47:03 +0000
branchRCL_3
changeset 78 dbcb928abe9c
parent 18 bcb43dc84c44
permissions -rw-r--r--
Adjusted to avoid exports, etc, from a top-level bld.inf

/*
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:    Upload cenrep watcher
*
*/

#ifndef __GLXUPLOADCENREPWATCHER_H__
#define __GLXUPLOADCENREPWATCHER_H__


class CGlxCommandHandlerUpload;

/**
 *  CGlxUploadCenRepWatcher
 *  CGlxCommandHandlerUpload containted class for observing changes in central 
 *                   repository values
 */
NONSHARABLE_CLASS( CGlxUploadCenRepWatcher ) : public CActive
    {
    public:  // Constructors and destructor

        /**
         * Symbian Constructor.
         * @param aObserver obersver - only supplied when the owner is 
         *  interested in changes in key value
         * @param aRepositoryUid uid of Central Repository file
         * @param aId id of the Central Repository key
         * @return contructed object
         */
        static CGlxUploadCenRepWatcher* NewL(MGlxUploadIconObserver& aUploadIconObserver,
                                             const TUid& aRepositoryUid,
                                             TUint32 aId );
        /**
         * Destructor.
         */
        ~CGlxUploadCenRepWatcher();
        
    public: // API

        /**
         * Get current value as 16 bit descriptor.
         * @param return value of the key in the descriptor
         */
        void KeyValueL(TDes& aKeyValue) const;
 
    private: // Implementation

        /**
         * C++ constructor.
         * @param aObserver obersver		 
         * @param aRepositoryUid uid of CenRep file
         * @param aId id of the key
         * @return contructed object
         */
        CGlxUploadCenRepWatcher(MGlxUploadIconObserver& aUploadIconObserver,
                                const TUid& aRepositoryUid, TUint32 aId );

        /**
         * 2nd phase constructor
         */
        void ConstructL();

    protected: // from CActive

        /**
         * @ref CActive::RunL
         */
        void RunL();

        /**
         * @ref CActive::DoCancel
         */
        void DoCancel();
        
        /**
         * @ref CActive::RunError
         */
        TInt RunError( TInt aError );

    private: // Implementation
        // Not Owned: the upload icon observer
        MGlxUploadIconObserver& iUploadIconObserver;
        // Own: the central repository API
        CRepository* iRepository;       
        // the central repository identifier
        TUid iRepositoryUid;
        // the key id
        TUint32 iId;
        
    };

#endif //__GLXUPLOADCENREPWATCHER_H__