javaextensions/pim/framework/src.s60/cpimvaluebase.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 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:  A base class for holding PIM field values
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // CLASS HEADER
       
    20 #include "cpimvaluebase.h"
       
    21 
       
    22 // INTERNAL INCLUDES
       
    23 #include "pimpanics.h"
       
    24 #include "pimcommon.h"
       
    25 #include "logger.h"
       
    26 
       
    27 // ======== MEMBER FUNCTIONS ========
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 // Destructor
       
    31 // ---------------------------------------------------------------------------
       
    32 //
       
    33 CPIMValueBase::~CPIMValueBase()
       
    34 {
       
    35     JELOG2(EPim);
       
    36     delete iLabelArray;
       
    37     delete iInternalAttributes;
       
    38 }
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // CPIMValueBase::SetValue
       
    42 // (other items were commented in a header)
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 void CPIMValueBase::SetIntValue(TInt /*aIntegerValue*/)
       
    46 {
       
    47     JELOG2(EPim);
       
    48     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
    49 }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // CPIMValueBase::SetValue
       
    53 // (other items were commented in a header)
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 void CPIMValueBase::SetBooleanValue(TBool /*aBooleanValue*/)
       
    57 {
       
    58     JELOG2(EPim);
       
    59     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
    60 }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // CPIMValueBase::SetValue
       
    64 // (other items were commented in a header)
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CPIMValueBase::SetDateValue(TPIMDate /*aDateValue*/)
       
    68 {
       
    69     JELOG2(EPim);
       
    70     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
    71 }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // CPIMValueBase::SetValue
       
    75 // (other items were commented in a header)
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 void CPIMValueBase::SetStringValue(const HBufC* /*aStringValue*/)
       
    79 {
       
    80     JELOG2(EPim);
       
    81     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
    82 }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CPIMValueBase::SetValue
       
    86 // (other items were commented in a header)
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 void CPIMValueBase::SetStringArrayValue(const CDesCArray* /*aStringArrayValue*/)
       
    90 {
       
    91     JELOG2(EPim);
       
    92     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
    93 }
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // CPIMValueBase::SetValue
       
    97 // (other items were commented in a header)
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 void CPIMValueBase::SetBinaryValue(const CPIMByteArray* /*aBinaryValue*/)
       
   101 {
       
   102     JELOG2(EPim);
       
   103     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   104 }
       
   105 
       
   106 // ---------------------------------------------------------------------------
       
   107 // CPIMValueBase::Value
       
   108 // (other items were commented in a header)
       
   109 // ---------------------------------------------------------------------------
       
   110 //
       
   111 TInt CPIMValueBase::IntValue() const
       
   112 {
       
   113     JELOG2(EPim);
       
   114     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   115     return 0; // For the compiler
       
   116 }
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // CPIMValueBase::Value
       
   120 // (other items were commented in a header)
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 TBool CPIMValueBase::BooleanValue() const
       
   124 {
       
   125     JELOG2(EPim);
       
   126     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   127     return EFalse; // For the compiler
       
   128 }
       
   129 
       
   130 // ---------------------------------------------------------------------------
       
   131 // CPIMValueBase::Value
       
   132 // (other items were commented in a header)
       
   133 // ---------------------------------------------------------------------------
       
   134 //
       
   135 TPIMDate CPIMValueBase::DateValue() const
       
   136 {
       
   137     JELOG2(EPim);
       
   138     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   139     return Time::NullTTime(); // For the compiler
       
   140 }
       
   141 
       
   142 // ---------------------------------------------------------------------------
       
   143 // CPIMValueBase::Value
       
   144 // (other items were commented in a header)
       
   145 // ---------------------------------------------------------------------------
       
   146 //
       
   147 const HBufC* CPIMValueBase::StringValue() const
       
   148 {
       
   149     JELOG2(EPim);
       
   150     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   151     const HBufC* ret = NULL;
       
   152     return ret; // For the compiler
       
   153 }
       
   154 
       
   155 // ---------------------------------------------------------------------------
       
   156 // CPIMValueBase::Value
       
   157 // (other items were commented in a header)
       
   158 // ---------------------------------------------------------------------------
       
   159 //
       
   160 const CDesCArray* CPIMValueBase::StringArrayValue() const
       
   161 {
       
   162     JELOG2(EPim);
       
   163     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   164     CDesCArray* ret = NULL;
       
   165     return ret; // For the compiler
       
   166 }
       
   167 
       
   168 // ---------------------------------------------------------------------------
       
   169 // CPIMValueBase::Value
       
   170 // (other items were commented in a header)
       
   171 // ---------------------------------------------------------------------------
       
   172 //
       
   173 const CPIMByteArray* CPIMValueBase::BinaryValue() const
       
   174 {
       
   175     JELOG2(EPim);
       
   176     __ASSERT_DEBUG(EFalse, User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
       
   177     CPIMByteArray* ret = NULL;
       
   178     return ret; // For the compiler
       
   179 }
       
   180 
       
   181 // ---------------------------------------------------------------------------
       
   182 // CPIMValueBase::NumElements
       
   183 // (other items were commented in a header)
       
   184 // ---------------------------------------------------------------------------
       
   185 //
       
   186 TInt CPIMValueBase::NumElements() const
       
   187 {
       
   188     JELOG2(EPim);
       
   189     return 1; // Default is one for other fields than string arrays
       
   190 }
       
   191 
       
   192 // ---------------------------------------------------------------------------
       
   193 // CPIMValueBase::SetInternalAttributes
       
   194 // (other items were commented in a header)
       
   195 // ---------------------------------------------------------------------------
       
   196 //
       
   197 void CPIMValueBase::SetInternalAttributes(CArrayFix<TUid>* aInternalAttributes)
       
   198 {
       
   199     JELOG2(EPim);
       
   200     delete iInternalAttributes;
       
   201     iInternalAttributes = aInternalAttributes;
       
   202 }
       
   203 
       
   204 // ---------------------------------------------------------------------------
       
   205 // CPIMValueBase::SetAttributes
       
   206 // (other items were commented in a header)
       
   207 // ---------------------------------------------------------------------------
       
   208 //
       
   209 void CPIMValueBase::SetAttributes(TPIMAttribute aAttributes)
       
   210 {
       
   211     JELOG2(EPim);
       
   212     iAttributes = aAttributes;
       
   213 }
       
   214 
       
   215 // ---------------------------------------------------------------------------
       
   216 // CPIMValueBase::InternalAttributes
       
   217 // (other items were commented in a header)
       
   218 // ---------------------------------------------------------------------------
       
   219 //
       
   220 const CArrayFix<TUid>& CPIMValueBase::InternalAttributes() const
       
   221 {
       
   222     JELOG2(EPim);
       
   223     __ASSERT_DEBUG(iInternalAttributes, User::Panic(KPIMPanicCategory,
       
   224                    EPIMPanicInvalidState));
       
   225     return *iInternalAttributes;
       
   226 }
       
   227 
       
   228 // ---------------------------------------------------------------------------
       
   229 // CPIMValueBase::Attributes
       
   230 // (other items were commented in a header)
       
   231 // ---------------------------------------------------------------------------
       
   232 //
       
   233 const TPIMAttribute& CPIMValueBase::Attributes() const
       
   234 {
       
   235     JELOG2(EPim);
       
   236     return iAttributes;
       
   237 }
       
   238 
       
   239 // ---------------------------------------------------------------------------
       
   240 // CPIMValueBase::SetValueLabelsL
       
   241 // (other items were commented in a header)
       
   242 // ---------------------------------------------------------------------------
       
   243 //
       
   244 void CPIMValueBase::SetLabels(CDesCArray* aLabelArray)
       
   245 {
       
   246     JELOG2(EPim);
       
   247     delete iLabelArray;
       
   248     iLabelArray = aLabelArray;
       
   249 }
       
   250 
       
   251 // ---------------------------------------------------------------------------
       
   252 // CPIMValueBase::Labels
       
   253 // (other items were commented in a header)
       
   254 // ---------------------------------------------------------------------------
       
   255 //
       
   256 CDesCArray* CPIMValueBase::Labels() const
       
   257 {
       
   258     JELOG2(EPim);
       
   259     return iLabelArray;
       
   260 }
       
   261 
       
   262 // ---------------------------------------------------------------------------
       
   263 // CPIMValueBase::CPIMValueBase
       
   264 // Default C++ constructor
       
   265 // ---------------------------------------------------------------------------
       
   266 //
       
   267 CPIMValueBase::CPIMValueBase(TPIMAttribute aAttributes) :
       
   268         iAttributes(aAttributes), iInternalAttributes(KPIMAttrNone)
       
   269 {
       
   270     JELOG2(EPim);
       
   271 }
       
   272 
       
   273 // End of file