mulwidgets/muldatamodel/src/mulactionitem.cpp
branchRCL_3
changeset 19 4ea6f81c838a
parent 17 514d98f21c43
child 20 0e9bb658ef58
equal deleted inserted replaced
17:514d98f21c43 19:4ea6f81c838a
     1 /*
       
     2 * Copyright (c) 2007-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:   Action item class implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // includes
       
    20 #include "mulactionitem.h"
       
    21 
       
    22 #include <stdexcept>
       
    23 
       
    24 namespace Alf
       
    25 	{
       
    26 
       
    27 static const char* const KNotImplemented = "Not Implemented";
       
    28 static const char* const KInvalidArgument = "Invalid Parameter";
       
    29 
       
    30 // ---------------------------------------------------------------------------
       
    31 // Constructor
       
    32 // ---------------------------------------------------------------------------
       
    33 //		
       
    34 OSN_EXPORT MulActionItem::MulActionItem(TMulActionType aType, MulActionData* aData):
       
    35 	mType(aType)	
       
    36 	{       
       
    37 	if( !aData )
       
    38 	    {
       
    39 	    throw std::invalid_argument(std::string(KInvalidArgument));
       
    40 	    }
       
    41 	mData = aData;    
       
    42 	}
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // Constructor
       
    46 // ---------------------------------------------------------------------------
       
    47 //		
       
    48 OSN_EXPORT MulActionItem::MulActionItem( const MulActionItem& aActionItem )
       
    49 	{
       
    50 	mType = aActionItem.mType;
       
    51 	mData.reset( new (EMM) MulActionData(*aActionItem.mData.get()));
       
    52 	}
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // Destructor
       
    56 // ---------------------------------------------------------------------------
       
    57 //		
       
    58 OSN_EXPORT MulActionItem::~MulActionItem()
       
    59 	{
       
    60 	// No implemnetation.    	
       
    61 	}
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // SetActionType
       
    65 // ---------------------------------------------------------------------------
       
    66 //		
       
    67 OSN_EXPORT void MulActionItem::SetActionType( TMulActionType aType)
       
    68 	{
       
    69 	mType = aType;		
       
    70 	}
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // ActionType
       
    74 // ---------------------------------------------------------------------------
       
    75 //		
       
    76 OSN_EXPORT MulActionItem::TMulActionType MulActionItem::ActionType() const
       
    77 	{
       
    78 	return mType;
       
    79 	}
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // SetActionData
       
    83 // ---------------------------------------------------------------------------
       
    84 //		
       
    85 OSN_EXPORT void MulActionItem::SetActionData( MulActionData* aData )
       
    86 	{
       
    87 	if( !aData )
       
    88 	    {
       
    89 	    throw std::invalid_argument(std::string(KInvalidArgument));    
       
    90 	    }
       
    91 	    
       
    92 	mData = aData;
       
    93 	}
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // ActionData
       
    97 // ---------------------------------------------------------------------------
       
    98 //		
       
    99 OSN_EXPORT const MulActionData& MulActionItem::ActionData() const
       
   100 	{
       
   101 	return *mData.get();
       
   102 	}
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // Type
       
   106 // ---------------------------------------------------------------------------
       
   107 //	
       
   108 //const UString& MulActionItem::Type()
       
   109 //	{
       
   110 //	mActionString.reset(new UString(mulactionitem::KActionString));
       
   111 //    return *mActionString.get();
       
   112 //	}
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // Clone
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118 OSN_EXPORT std::auto_ptr< IMulVariantType > MulActionItem::Clone()
       
   119 	{
       
   120 	std::auto_ptr<MulActionData> actionData( new (EMM) MulActionData(*mData));
       
   121 	std::auto_ptr<IMulVariantType> clone ( new (EMM) MulActionItem( ActionType(), actionData.get()));
       
   122 	actionData.release();
       
   123 	return clone;
       
   124 	}
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // set
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 OSN_EXPORT void MulActionItem::set(IAlfVariantType& /*aValue*/)
       
   131 	{
       
   132 	throw std::logic_error(KNotImplemented);
       
   133 	}
       
   134 
       
   135 // ---------------------------------------------------------------------------
       
   136 // type
       
   137 // ---------------------------------------------------------------------------
       
   138 //
       
   139 OSN_EXPORT IAlfVariantType::Type MulActionItem::type() const
       
   140 	{
       
   141 	throw std::logic_error(KNotImplemented);
       
   142 	}
       
   143 
       
   144 // ---------------------------------------------------------------------------
       
   145 // boolean
       
   146 // ---------------------------------------------------------------------------
       
   147 //
       
   148 OSN_EXPORT bool MulActionItem::boolean() const
       
   149 	{
       
   150 	throw std::logic_error(KNotImplemented);
       
   151 	}
       
   152 
       
   153 // ---------------------------------------------------------------------------
       
   154 // integer
       
   155 // ---------------------------------------------------------------------------
       
   156 //
       
   157 OSN_EXPORT int MulActionItem::integer() const
       
   158 	{
       
   159 	throw std::logic_error(KNotImplemented);
       
   160 	}
       
   161 
       
   162 // ---------------------------------------------------------------------------
       
   163 // uinteger
       
   164 // ---------------------------------------------------------------------------
       
   165 //
       
   166 OSN_EXPORT uint MulActionItem::uinteger() const
       
   167 	{
       
   168 	throw std::logic_error(KNotImplemented);
       
   169 	}
       
   170 
       
   171 // ---------------------------------------------------------------------------
       
   172 // real
       
   173 // ---------------------------------------------------------------------------
       
   174 //
       
   175 OSN_EXPORT double MulActionItem::real() const
       
   176 	{
       
   177 	throw std::logic_error(KNotImplemented);
       
   178 	}
       
   179 
       
   180 // ---------------------------------------------------------------------------
       
   181 // string
       
   182 // ---------------------------------------------------------------------------
       
   183 //
       
   184 OSN_EXPORT const UString& MulActionItem::string() const 
       
   185 	{
       
   186 	throw std::logic_error(KNotImplemented);
       
   187 	}
       
   188 
       
   189 // ---------------------------------------------------------------------------
       
   190 // container
       
   191 // ---------------------------------------------------------------------------
       
   192 //
       
   193 OSN_EXPORT IAlfContainer* MulActionItem::container() 
       
   194 	{
       
   195 	throw std::logic_error(KNotImplemented);
       
   196 	}
       
   197 
       
   198 // ---------------------------------------------------------------------------
       
   199 // map
       
   200 // ---------------------------------------------------------------------------
       
   201 //
       
   202 OSN_EXPORT IAlfMap* MulActionItem::map() 
       
   203 	{
       
   204 	throw std::logic_error(KNotImplemented);
       
   205 	}
       
   206 
       
   207 // ---------------------------------------------------------------------------
       
   208 // branch
       
   209 // ---------------------------------------------------------------------------
       
   210 //
       
   211 OSN_EXPORT IAlfBranch* MulActionItem::branch() 
       
   212 	{
       
   213 	throw std::logic_error(KNotImplemented);
       
   214 	}
       
   215 
       
   216 // ---------------------------------------------------------------------------
       
   217 // customData
       
   218 // ---------------------------------------------------------------------------
       
   219 //
       
   220 OSN_EXPORT IAlfModelBase* MulActionItem::customData() 
       
   221 	{
       
   222 	throw std::logic_error(KNotImplemented);
       
   223 	}
       
   224 		
       
   225 	} // namespace ends 
       
   226 	
       
   227 // End of file