upnpmediaserver/contentdirectoryservice/inc/upnplocalstorage.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Local interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef UPNPLOCALSTORAGE_H
       
    21 #define UPNPLOCALSTORAGE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <upnpobject.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CUpnpMetadataStorage;
       
    29 class CUpnpItem;
       
    30 class CUpnpItemList;
       
    31 class CUpnpContainerList;
       
    32 class CUpnpBrowseCriteria;
       
    33 class CUpnpContainer;
       
    34 class CUpnpObjectBean;
       
    35 class CUpnpElement;
       
    36 class CUpnpElementBean;
       
    37 class CUpnpAttributeBean;
       
    38 class CUpnpAttribute;
       
    39 class CUpnpObject;
       
    40 class CUpnpContentDirectory;
       
    41 class CUpnpStateHandler;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 /**
       
    46 *  Local interface
       
    47 *
       
    48 *  @lib avcontentdirectory.lib
       
    49 *  @since Series 60 3.0
       
    50 */
       
    51 class CUpnpLocalStorage : public CBase
       
    52 {
       
    53 public:  // Constructors and destructor
       
    54     
       
    55     /**
       
    56     * Two-phased constructor.
       
    57     */
       
    58     static CUpnpLocalStorage* NewL(CUpnpMetadataStorage* aMetadataStorage);
       
    59     static CUpnpLocalStorage* NewLC(CUpnpMetadataStorage* aMetadataStorage);
       
    60     
       
    61     /**
       
    62     * Destructor.
       
    63     */
       
    64     virtual ~CUpnpLocalStorage();
       
    65 
       
    66 public: // New functions
       
    67     
       
    68 		void ShareObjectL(CUpnpObject* aItem);
       
    69 		void ShareReferenceL( CUpnpItem* aItem );
       
    70 		void ShareReferenceListL( CUpnpItemList* aItemList, TInt* aExecutionStatus );
       
    71 		void UnshareItemL(TInt aItemId);
       
    72 		void UnshareContainerL(TInt aItemId);
       
    73 		CUpnpItem* GetSharedItemL(TInt aItemId);
       
    74 		void ShareItemListL(CUpnpItemList* aItemList, TInt* aExecutionStatus);
       
    75 		void UnshareItemListL(RArray<TInt>& aItemList, TInt* aExecutionStatus);
       
    76 		void GetItemListL(TInt aContainerId, CUpnpBrowseCriteria* aBrowseCriteria, TInt* aTotalMatches, CUpnpItemList* aItemList);
       
    77 		void GetContainerListL(TInt aContainerId, CUpnpBrowseCriteria* aBrowseCriteria, TInt* aTotalMatches, CUpnpContainerList* aList);
       
    78 		void SetStateHandler(CUpnpStateHandler* aStateHandler);
       
    79 		CUpnpContainer* GetSingleContainerL(TInt aContainerId);
       
    80 
       
    81     private:
       
    82 
       
    83         /**
       
    84         * C++ default constructor.
       
    85         */
       
    86         CUpnpLocalStorage(CUpnpMetadataStorage* aMetadataStorage);
       
    87 
       
    88         /**
       
    89         * By default Symbian 2nd phase constructor is private.
       
    90         */
       
    91         void ConstructL();
       
    92         
       
    93         void AddAttributesL( TInt aElmId, CUpnpElement* aElm );
       
    94         void AddElementsL( TInt aObjectID, CUpnpObject* aObj );
       
    95         void GetObjectL(TInt aObjId, CUpnpObject* aObj, TBool aAll = ETrue);
       
    96         void HandleResourcesL(CUpnpObject* aItem);
       
    97 		void DoShareObjectL(TInt aContainer, CUpnpObject* aItem);
       
    98 		void DoShareReferenceL( TInt aContainerId, CUpnpItem* aRefItem ); 
       
    99 		CUpnpObjectBean* CreateObjectBeanLC(CUpnpObject* aItem);
       
   100 		CUpnpElementBean* CreateElementBeanLC(CUpnpElement& aItem);
       
   101 		CUpnpAttributeBean* CreateAttributeBeanLC(CUpnpAttribute& aAttr);
       
   102 		void ValidateContainerL(TInt aContainerId);
       
   103 		void ValidateItemL(TInt aItemId);
       
   104 		HBufC8* ValAsUriL(const TDesC8& aElmValue) const ;
       
   105 		TInt ReferedObjectIdL(TInt aObjectId);
       
   106 
       
   107 private:    // Data
       
   108     CUpnpMetadataStorage*   iMetadataStorage; // not owned
       
   109     CUpnpStateHandler* iStateHandler; // not owned
       
   110 
       
   111 };
       
   112 
       
   113 #endif      // UPNPLOCALSTORAGE_H
       
   114         
       
   115 // End of File