upnpmediaserver/contentdirectoryservice/inc/upnpelementbean.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:  Element table data handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CUPNPELEMENTBEAN_H
       
    21 #define C_CUPNPELEMENTBEAN_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "upnptablebean.h"
       
    25 #include <e32base.h>
       
    26 #include <d32dbms.h>
       
    27 
       
    28 class CUpnpElement;
       
    29 class CUpnpObject;
       
    30 class CUri8;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Stores the data of element table row.
       
    36 *
       
    37 *  @lib AVContentDirectory.lib
       
    38 *  @since Series60 3.1
       
    39 */
       
    40 class CUpnpElementBean: public CUpnpTableBean 
       
    41 {
       
    42 public:  // Constructors and destructor
       
    43     
       
    44     /**
       
    45     * Two-phased constructor.
       
    46     */
       
    47     static CUpnpElementBean* NewLC();
       
    48 
       
    49     /**
       
    50     * Two-phased constructor.
       
    51     * @param aRowSet
       
    52     */
       
    53     static CUpnpElementBean* NewLC(const RDbRowSet& aRowSet);
       
    54     
       
    55     
       
    56     /**
       
    57     * Destructor.
       
    58     */
       
    59     virtual ~CUpnpElementBean();
       
    60 
       
    61 public: // New functions
       
    62     
       
    63         CUpnpElement* AttachElmL(CUpnpObject* aElm);
       
    64     /**
       
    65     * Sets all values of the object value.
       
    66     * @since Series S60 3.0
       
    67     * @param aRowSet
       
    68     */
       
    69     void SetL(const RDbRowSet& aRowSet);
       
    70     
       
    71     /**
       
    72     * Sets iElmId value.
       
    73     * @since Series S60 3.0
       
    74     * @param aElId value of elm_id in the element table
       
    75     */
       
    76     void SetElmId(TInt aElId);
       
    77         
       
    78     /**
       
    79     * Sets iElmName value.
       
    80     * @since Series S60 3.0
       
    81     * @param aElmName value of elm_name in the element table
       
    82     */
       
    83     void SetElmNameL(const TDesC8& aElmName);
       
    84         
       
    85     /**
       
    86     * Sets iElmHasAttribute value.
       
    87     * @since Series S60 3.0
       
    88     * @param aElmHasAttribute value of elm_has_attribute in the element table
       
    89     */
       
    90     void SetElmHasAttribute(TBool aElmHasAttribute);
       
    91         
       
    92     /**
       
    93     * Sets iElmIsRequired value.
       
    94     * @since Series S60 3.0
       
    95     * @param aElmIsRequired value of elm_is_required in the element table
       
    96     */
       
    97     void SetElmIsRequired(TBool aElmIsRequired);
       
    98         
       
    99     /**
       
   100     * Sets iElmValue value.
       
   101     * @since Series S60 3.0
       
   102     * @param aElmValue value of elm_value in the element table
       
   103     */
       
   104     void SetElmValueL(const RDbRowSet& aRowSet, const TInt aColNo);
       
   105 		void SetElmValueL(const TDesC8& aVal);
       
   106         
       
   107     /**
       
   108     * Sets iElmObjId value.
       
   109     * @since Series S60 3.0
       
   110     * @param aElmObjId value of elm_obj_id in the element table
       
   111     */
       
   112     void SetElmObjId(TInt aElmObjId);
       
   113         
       
   114     /**
       
   115     * Gets iElmId value.
       
   116     * @since Series S60 3.0
       
   117     * @return Gets the value of iElmId
       
   118     */
       
   119     TInt ElmId() const;
       
   120         
       
   121     /**
       
   122     * Gets iElmName value.
       
   123     * @since Series S60 3.0
       
   124     * @return Value of iElmName
       
   125     */
       
   126 		TDesC8& ElmName() const;
       
   127         
       
   128     /**
       
   129     * Gets iElmHasAttribute value.
       
   130     * @since Series S60 3.0
       
   131     * @return Gets the value of iElmHasAttribute
       
   132     */
       
   133     TBool ElmHasAttribute() const;
       
   134         
       
   135     /**
       
   136     * Gets iElmIsRequired value.
       
   137     * @since Series S60 3.0
       
   138     * @return Gets the value of iElmIsRequired
       
   139     */
       
   140     TBool ElmIsRequired() const;
       
   141         
       
   142     /**
       
   143     * Gets iElmValue value.
       
   144     * @since Series S60 3.0
       
   145     * @return Value of iElmValue
       
   146     */
       
   147     TDesC8& ElmValue() const;
       
   148         
       
   149     /**
       
   150     * Gets iElmObjId value.
       
   151     * @since Series S60 3.0
       
   152     * @return Gets the value of iElmObjId
       
   153     */
       
   154     TInt ElmObjId() const;
       
   155         
       
   156     /**
       
   157     * Adds the whole element to the given TXmlEngElement.
       
   158     * @param aElement a element to which the value will be attached
       
   159     * @since Series S60 3.0
       
   160     */
       
   161     TXmlEngElement AttachElmL(TXmlEngElement aElement) const;
       
   162 
       
   163 
       
   164 private:
       
   165 
       
   166     /**
       
   167     * C++ default constructor.
       
   168     */
       
   169     CUpnpElementBean();
       
   170 
       
   171     /**
       
   172     * By default Symbian 2nd phase constructor is private.
       
   173     */
       
   174     void ConstructL();
       
   175     
       
   176     HBufC8* ValAsUriL() const;
       
   177 
       
   178 private:    // Data
       
   179     // Element Id
       
   180     TInt        iElmId;
       
   181     // Element Name
       
   182     HBufC8*     iElmName;
       
   183     //
       
   184     TBool       iElmHasAttribute;
       
   185     // 
       
   186     TInt        iElmObjId;
       
   187     //
       
   188     TBool       iElmIsRequired;
       
   189     // Element Value
       
   190     HBufC8*     iElmValue;
       
   191 };
       
   192 
       
   193 // inline functions
       
   194 #include"upnpelementbean.inl"
       
   195 
       
   196 #endif      // C_CUPNPELEMENTBEAN_H   
       
   197         
       
   198 // End of File