upnpmediaserver/contentdirectoryservice/inc/upnpobjectbean.h
changeset 0 7f85d04be362
child 12 cdcbf344a1d3
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:  Element table data handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CUPNPOBJECTBEAN_H
       
    21 #define C_CUPNPOBJECTBEAN_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "upnptablebean.h"
       
    25 #include <e32base.h>
       
    26 #include <d32dbms.h>
       
    27 #include <xmlengdom.h>
       
    28 
       
    29 class CUpnpObject;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  Stores the data of object table row.
       
    35 *
       
    36 *  @lib AVContentDirectory.lib
       
    37 *  @since Series60 3.1
       
    38 */
       
    39 class CUpnpObjectBean: public CUpnpTableBean 
       
    40 {
       
    41     public:  // Constructors and destructor
       
    42     
       
    43     /**
       
    44     * Two-phased constructor.
       
    45     */
       
    46     //static CUpnpObjectBean* NewL();
       
    47     static CUpnpObjectBean* NewLC();
       
    48     static CUpnpObjectBean* NewLC(const RDbRowSet& aRowSet);
       
    49     static CUpnpObjectBean* NewL(const RDbRowSet& aRowSet);
       
    50     
       
    51     /**
       
    52     * Destructor.
       
    53     */
       
    54     virtual ~CUpnpObjectBean();
       
    55 
       
    56     public: // New functions
       
    57     	void CopyToUpnpObjectL(CUpnpObject* aElement);
       
    58     /**
       
    59     * Sets 
       
    60     * @since Series S60 3.0
       
    61     * @param aRowSet
       
    62     */
       
    63     void SetL(const RDbRowSet& aRowSet);
       
    64 
       
    65     /**
       
    66     * Sets iObjId value.
       
    67     * @since Series S60 3.0
       
    68     * @param aObjId value of id in the 'object' table
       
    69     */
       
    70     void SetObjId(TInt aObjId);
       
    71 
       
    72     /**
       
    73     * Sets iObjParentId value.
       
    74     * @since Series S60 3.0
       
    75     * @param aObjParentId value of 'parentID' in the object table
       
    76     */
       
    77     void SetObjParentId(TInt aObjParentId);
       
    78 
       
    79     /**
       
    80     * Sets iObjTitle value.
       
    81     * @since Series S60 3.0
       
    82     * @param aObjTitle value of 'title' in the object table
       
    83     */
       
    84     void SetObjTitleL(const TDesC8& aObjTitle);
       
    85 
       
    86     /**
       
    87     * Sets iObjClass value.
       
    88     * @since Series S60 3.0
       
    89     * @param aObjClass value of 'class' in the object table
       
    90     */
       
    91     void SetObjClassL(const TDesC8& aObjClass);
       
    92 
       
    93     /**
       
    94     * Sets iObjRestricted value.
       
    95     * @since Series S60 3.0
       
    96     * @param aObjRestricted value of 'restricted' in the object table
       
    97     */
       
    98     void SetObjRestricted(TBool aObjRestricted);
       
    99 
       
   100     /**
       
   101     * Sets iObjSearchable value.
       
   102     * @since Series S60 3.0
       
   103     * @param aObjSearchable value of 'searchable' in the object table, -1 when undefined
       
   104     */
       
   105     void SetObjSearchable(TInt aObjSearchable);
       
   106 
       
   107     /**
       
   108     * Sets iObjRefId value.
       
   109     * @since Series S60 3.0
       
   110     * @param aObjRefId value of 'refID' in the object table
       
   111     */
       
   112     void SetObjRefId(TInt aObjRefId);
       
   113         
       
   114     /**
       
   115     * Gets iElmId value.
       
   116     * @since Series S60 3.0
       
   117     * @return Gets the value of iElmId
       
   118     */  
       
   119     TInt ObjId() const;
       
   120         
       
   121     /**
       
   122     * Gets iElmId value.
       
   123     * @since Series S60 3.0
       
   124     * @return Gets the value of iElmId
       
   125     */  
       
   126     TInt ObjParentId() const;
       
   127         
       
   128     /**
       
   129     * Gets iElmId value.
       
   130     * @since Series S60 3.0
       
   131     * @return Gets the value of iElmId
       
   132     */  
       
   133     TDesC8& ObjTitle() const;
       
   134         
       
   135     /**
       
   136     * Gets iElmId value.
       
   137     * @since Series S60 3.0
       
   138     * @return Gets the value of iElmId
       
   139     */  
       
   140     TDesC8& ObjClass() const;
       
   141         
       
   142     /**
       
   143     * Gets iElmId value.
       
   144     * @since Series S60 3.0
       
   145     * @return Gets the value of iElmId
       
   146     */  
       
   147     TBool ObjRestricted() const;
       
   148         
       
   149     /**
       
   150     * Gets iElmId value.
       
   151     * @since Series S60 3.0
       
   152     * @return Gets the value of iElmId
       
   153     */  
       
   154     TInt ObjSearchable() const;
       
   155         
       
   156     /**
       
   157     * Gets iElmId value.
       
   158     * @since Series S60 3.0
       
   159     * @return Gets the value of iElmId
       
   160     */  
       
   161     TInt ObjRefId() const;
       
   162         
       
   163     /**
       
   164     * Adds object element and all required properties to the given TXmlEngElement.
       
   165     * @since Series S60 3.0
       
   166     * @param aElement
       
   167     * @return TXmlEngElement just added object alement
       
   168     */  
       
   169     TXmlEngElement AttachObjectElL(TXmlEngElement aElement);
       
   170         
       
   171     /**
       
   172     * Adds object element and all properties to the given TXmlEngElement.
       
   173     * @since Series S60 3.0
       
   174     * @param aElement
       
   175     */  
       
   176     TXmlEngElement AttachWholeObjectElL(TXmlEngElement aElement);
       
   177 
       
   178     /**
       
   179     * Adds refId attribute to the given object's TXmlEngElement.
       
   180     * @since Series S60 3.0
       
   181     * @param aElement
       
   182     * @return TXmlEngAttr just added object alement
       
   183     */  
       
   184     void AttachRefIdL(TXmlEngElement aElement);
       
   185     
       
   186     /**
       
   187     * Adds searchable attr to the given object's TXmlEngElement.
       
   188     * @since Series S60 3.0
       
   189     * @param aElement
       
   190     * @return TXmlEngAttr just added object alement
       
   191     */  
       
   192     void AttachSearchableL(TXmlEngElement aElement);
       
   193  
       
   194  private: 
       
   195     /**
       
   196     * Adds all required properties to the given object's TXmlEngElement.
       
   197     * @since Series S60 3.0
       
   198     * @param aElement
       
   199     */  
       
   200     void AttachRequiredPropertiesL(TXmlEngElement);
       
   201         
       
   202     /**
       
   203     * Adds id attr to the given object's TXmlEngElement.
       
   204     * @since Series S60 3.0
       
   205     * @param aElement
       
   206     */  
       
   207     void AttachIdL(TXmlEngElement aElement);
       
   208     
       
   209     /**
       
   210     * Adds ParentId attr to the given object's TXmlEngElement.
       
   211     * @since Series S60 3.0
       
   212     * @param aElement
       
   213     */  
       
   214     void AttachParentIdL(TXmlEngElement aElement);
       
   215     
       
   216     /**
       
   217     * Adds restricted attr to the given object's TXmlEngElement.
       
   218     * @since Series S60 3.0
       
   219     * @param aElement
       
   220     * @return TXmlEngAttr just added object alement
       
   221     */  
       
   222     void AttachRestrictedL(TXmlEngElement aElement);
       
   223 
       
   224     /**
       
   225     * Adds title element to the given object's TXmlEngElement.
       
   226     * @since Series S60 3.0
       
   227     * @param aElement
       
   228     */  
       
   229     void AttachTitleL(TXmlEngElement aElement);
       
   230     
       
   231     /**
       
   232     * Adds class element to the given object's TXmlEngElement.
       
   233     * @since Series S60 3.0
       
   234     * @param aElement
       
   235     */  
       
   236     void AttachClassL(TXmlEngElement aElement);
       
   237         
       
   238         
       
   239     private:
       
   240 
       
   241     /**
       
   242     * C++ default constructor.
       
   243     */
       
   244     CUpnpObjectBean();
       
   245 
       
   246     /**
       
   247     * By default Symbian 2nd phase constructor is private.
       
   248     */
       
   249     void ConstructL();
       
   250 
       
   251     private:    // Data
       
   252         
       
   253     // Object Id
       
   254     TInt        iObjId;
       
   255     // Object parent Id
       
   256     TInt        iObjParentId;
       
   257     // Object Title
       
   258     HBufC8*     iObjTitle;
       
   259     // Object Class
       
   260     HBufC8*     iObjClass;
       
   261     //
       
   262     TBool       iObjRestricted;
       
   263     //
       
   264     TInt        iObjSearchable;
       
   265     // Object Reference Id
       
   266     TInt        iObjRefId;
       
   267 };
       
   268 
       
   269 // inline functions
       
   270 #include"upnpobjectbean.inl"
       
   271 
       
   272 #endif      // C_CUPNPOBJECTBEAN_H   
       
   273 // End of File