javaextensions/pim/common/src.s60/tpimfielddata.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:  Class for holding PIM field data
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // CLASS HEADER
       
    20 #include "tpimfielddata.h"
       
    21 
       
    22 // INTERNAL INCLUDES
       
    23 #include "pimpanics.h"
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // TPIMFieldData::Field
       
    27 // Other items were commented in the header
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 TPIMField TPIMFieldData::Field() const
       
    31 {
       
    32     return iField;
       
    33 }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // TPIMFieldData::FieldDataType
       
    37 // Other items were commented in the header
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 TPIMFieldDataType TPIMFieldData::FieldDataType() const
       
    41 {
       
    42     return iDataType;
       
    43 }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // TPIMFieldData::Index
       
    47 // Other items were commented in the header
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 TInt TPIMFieldData::Index() const
       
    51 {
       
    52     return iIndex;
       
    53 }
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // TPIMFieldData::SetIndex
       
    57 // Other items were commented in the header
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void TPIMFieldData::SetIndex(TInt aIndex)
       
    61 {
       
    62     iIndex = aIndex;
       
    63 }
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // TPIMFieldData::Attributes
       
    67 // Other items were commented in the header
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 TPIMAttribute TPIMFieldData::Attributes() const
       
    71 {
       
    72     return iAttributes;
       
    73 }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // TPIMFieldData::IntegerValue
       
    77 // Other items were commented in the header
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 TInt TPIMFieldData::IntegerValue() const
       
    81 {
       
    82     __ASSERT_ALWAYS(iDataType == EPIMFieldInt, User::Panic(KPIMPanicCategory,
       
    83                     EPIMPanicInvalidFieldType));
       
    84 
       
    85     return iIntegerBooleanValue;
       
    86 }
       
    87 
       
    88 // ---------------------------------------------------------------------------
       
    89 // TPIMFieldData::BooleanValue
       
    90 // Other items were commented in the header
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 TBool TPIMFieldData::BooleanValue() const
       
    94 {
       
    95     __ASSERT_ALWAYS(iDataType == EPIMFieldBoolean, User::Panic(
       
    96                         KPIMPanicCategory, EPIMPanicInvalidFieldType));
       
    97 
       
    98     return iIntegerBooleanValue;
       
    99 }
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // TPIMFieldData::DateValue
       
   103 // Other items were commented in the header
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 TPIMDate TPIMFieldData::DateValue() const
       
   107 {
       
   108     __ASSERT_ALWAYS(iDataType == EPIMFieldDate, User::Panic(KPIMPanicCategory,
       
   109                     EPIMPanicInvalidFieldType));
       
   110 
       
   111     return iDateValue;
       
   112 }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // TPIMFieldData::StringValue
       
   116 // Other items were commented in the header
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 const TDesC& TPIMFieldData::StringValue() const
       
   120 {
       
   121     __ASSERT_ALWAYS(iDataType == EPIMFieldString, User::Panic(
       
   122                         KPIMPanicCategory, EPIMPanicInvalidFieldType));
       
   123     return *iStringValue;
       
   124 }
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // TPIMFieldData::StringArrayValue
       
   128 // Other items were commented in the header
       
   129 // ---------------------------------------------------------------------------
       
   130 //
       
   131 const CDesCArray& TPIMFieldData::StringArrayValue() const
       
   132 {
       
   133     __ASSERT_ALWAYS(iDataType == EPIMFieldStringArray, User::Panic(
       
   134                         KPIMPanicCategory, EPIMPanicInvalidFieldType));
       
   135 
       
   136     return *iStringArrayValue;
       
   137 }
       
   138 
       
   139 // ---------------------------------------------------------------------------
       
   140 // TPIMFieldData::BinaryValue
       
   141 // Other items were commented in the header
       
   142 // ---------------------------------------------------------------------------
       
   143 //
       
   144 const CPIMByteArray& TPIMFieldData::BinaryValue() const
       
   145 {
       
   146     __ASSERT_ALWAYS(iDataType == EPIMFieldBinary, User::Panic(
       
   147                         KPIMPanicCategory, EPIMPanicInvalidFieldType));
       
   148 
       
   149     return *iBinaryValue;
       
   150 }
       
   151 
       
   152 // End of file