cbs/cbsui/UiSrc/RCbsUi.cpp
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     RCbsUi calls directly real cbs client, which handles
       
    16 *     the actual calls to server.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 //  INCLUDES
       
    22 #include "RCbsUi.h"
       
    23 #include <RCbs.h>
       
    24 
       
    25  
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 RCbsUi::RCbsUi()
       
    29     {
       
    30     }
       
    31 
       
    32 RCbsUi::~RCbsUi() 
       
    33     {
       
    34     }
       
    35 
       
    36 TInt RCbsUi::Connect()
       
    37     {
       
    38     return iServer.Connect();
       
    39     }
       
    40 
       
    41 void RCbsUi::Close()
       
    42     {
       
    43     iServer.Close();
       
    44     }
       
    45 
       
    46 TVersion RCbsUi::Version() const
       
    47     {
       
    48     return iServer.Version();
       
    49     }
       
    50 
       
    51 // Settings-related methods
       
    52 void RCbsUi::GetReceptionStatus( 
       
    53     TBool&  aStatus )
       
    54     {
       
    55     iServer.GetReceptionStatus( aStatus );
       
    56     }
       
    57 
       
    58 TInt RCbsUi::SetReceptionStatus( 
       
    59     TBool aStatus )
       
    60     {
       
    61     return iServer.SetReceptionStatus( aStatus );
       
    62     }
       
    63 
       
    64 void RCbsUi::GetTopicDetectionStatus( 
       
    65     TBool&  aStatus )
       
    66     {
       
    67     iServer.GetTopicDetectionStatus( aStatus );
       
    68     }
       
    69 
       
    70 TInt RCbsUi::SetTopicDetectionStatus( 
       
    71     TBool   aStatus )
       
    72     {
       
    73     return iServer.SetTopicDetectionStatus(aStatus);
       
    74     }
       
    75 
       
    76 void RCbsUi::GetLanguages( 
       
    77     TCbsSettingsLanguages& aLanguages )
       
    78     {
       
    79     iServer.GetLanguages(aLanguages);
       
    80     }
       
    81 
       
    82 TInt RCbsUi::SetLanguages( 
       
    83     const TCbsSettingsLanguages& aLanguages )
       
    84     {
       
    85     return iServer.SetLanguages(aLanguages);
       
    86     }
       
    87 
       
    88 void RCbsUi::NotifySettingsChanged( 
       
    89     TRequestStatus&     aStatus, 
       
    90     TCbsSettingsEvent&  aEvent )
       
    91     {
       
    92     iServer.NotifySettingsChanged( aStatus, aEvent );
       
    93     }
       
    94 
       
    95 void RCbsUi::NotifySettingsChangedCancel()
       
    96     {
       
    97     iServer.NotifySettingsChangedCancel();
       
    98     }
       
    99 
       
   100 // Topic Collection -related methods
       
   101 void RCbsUi::StartCollectionBrowsing()
       
   102     {
       
   103     iServer.StartCollectionBrowsing();
       
   104     }
       
   105 
       
   106 TBool RCbsUi::HasNextCollectionTopic()
       
   107     {
       
   108     return iServer.HasNextCollectionTopic();
       
   109     }
       
   110 
       
   111 TInt RCbsUi::NextCollectionTopic( 
       
   112     TCbsTopicInfo&      aInfo )
       
   113     {
       
   114     return iServer.NextCollectionTopic(aInfo);
       
   115     }
       
   116 
       
   117 // Topic List-related methods
       
   118 void RCbsUi::GetTopicCount( 
       
   119     TInt&   aCount )
       
   120     {
       
   121     iServer.GetTopicCount(aCount);
       
   122     }
       
   123 
       
   124 TInt RCbsUi::GetTopic( 
       
   125     const TInt      aIndex, 
       
   126     TCbsTopic&      aTopic )
       
   127     {
       
   128     return iServer.GetTopic(aIndex, aTopic);
       
   129     }
       
   130 
       
   131 TInt RCbsUi::FindTopicByNumber( 
       
   132     TCbsTopicNumber aNumber, 
       
   133     TCbsTopic& aTopic )
       
   134     {
       
   135     return iServer.FindTopicByNumber( aNumber, aTopic );
       
   136     }
       
   137 
       
   138 TInt RCbsUi::DeleteTopic( 
       
   139     TCbsTopicNumber aNumber )
       
   140     {
       
   141     return iServer.DeleteTopic(aNumber);
       
   142     }
       
   143 
       
   144 TInt RCbsUi::DeleteAllTopics()
       
   145     {
       
   146     return iServer.DeleteAllTopics();
       
   147     }
       
   148 
       
   149 TInt RCbsUi::AddTopic( 
       
   150     TCbsTopic&      aTopic )
       
   151     {
       
   152     return iServer.AddTopic(aTopic);
       
   153     }
       
   154 
       
   155 TInt RCbsUi::ChangeTopicNameAndNumber( 
       
   156     TCbsTopicNumber aOldNumber,
       
   157     TCbsTopicNumber aNewNumber, 
       
   158     const TCbsTopicName& aName )
       
   159     {
       
   160     return iServer.ChangeTopicNameAndNumber(aOldNumber, aNewNumber, aName);
       
   161     }
       
   162 
       
   163 TInt RCbsUi::ChangeTopicSubscriptionStatus( 
       
   164     TCbsTopicNumber aNumber,
       
   165     TBool aNewStatus )
       
   166     {
       
   167     return iServer.ChangeTopicSubscriptionStatus( aNumber, aNewStatus );
       
   168     }
       
   169 
       
   170 TInt RCbsUi::ChangeTopicHotmarkStatus( 
       
   171     TCbsTopicNumber aNumber,
       
   172     TBool aNewStatus )
       
   173     {
       
   174     return iServer.ChangeTopicHotmarkStatus( aNumber, aNewStatus );
       
   175     }
       
   176 
       
   177 void RCbsUi::NotifyOnTopicListEvent( 
       
   178     TRequestStatus&         aStatus, 
       
   179     const TInt              aRequested, 
       
   180     TCbsTopicListEvent&     aEvent, 
       
   181     TCbsTopicNumber&        aNumber )
       
   182     {
       
   183     iServer.NotifyOnTopicListEvent(aStatus, aRequested, aEvent, aNumber);
       
   184     }
       
   185 
       
   186 void RCbsUi::NotifyOnTopicListEventCancel()
       
   187     {
       
   188     iServer.NotifyOnTopicListEventCancel();
       
   189     }
       
   190 
       
   191 TInt RCbsUi::GetNewTopicsCount( 
       
   192     TInt&       aCount )
       
   193     {
       
   194     return iServer.GetNewTopicsCount(aCount);
       
   195     }
       
   196 
       
   197 TInt RCbsUi::GetLatestTopicNumber( TCbsTopicNumber& aNumber )
       
   198     {
       
   199     return iServer.GetLatestTopicNumber(aNumber);
       
   200     }
       
   201 
       
   202 void RCbsUi::GetUnreadMessageCount( 
       
   203     TInt&       aCount )
       
   204     {
       
   205     iServer.GetUnreadMessageCount(aCount);
       
   206     }
       
   207 
       
   208 void RCbsUi::GetHotmarkedMessageHandle( 
       
   209     TCbsMessageHandle&  aMessage )
       
   210     {
       
   211     iServer.GetHotmarkedMessageHandle(aMessage);
       
   212     }
       
   213 
       
   214 TInt RCbsUi::NumberOfUnreadHotmarkedMessages() 
       
   215     {
       
   216     return iServer.NumberOfUnreadHotmarkedMessages();
       
   217     }
       
   218 
       
   219 TInt RCbsUi::GetNextAndPrevTopicNumber( 
       
   220 	const TCbsTopicNumber& aCurrentTopicNumber,
       
   221 	TCbsTopicNumber& aPrevTopicNumber,
       
   222 	TCbsTopicNumber& aNextTopicNumber,
       
   223 	TInt& aPosition )
       
   224     {
       
   225     return iServer.GetNextAndPrevTopicNumber(
       
   226         aCurrentTopicNumber, aPrevTopicNumber, aNextTopicNumber, aPosition);
       
   227     }
       
   228 
       
   229 
       
   230 // Topic Messages-related methods
       
   231 TInt RCbsUi::GetMessageCount( 
       
   232     TCbsTopicNumber aNumber,
       
   233     TInt& aCount )
       
   234     {
       
   235     return iServer.GetMessageCount(aNumber, aCount);
       
   236     }
       
   237     
       
   238 TInt RCbsUi::GetMessage( 
       
   239     TCbsTopicNumber aNumber, 
       
   240     TInt            aIndex, 
       
   241     TCbsMessage&    aMessage )
       
   242     {
       
   243     return iServer.GetMessage(aNumber, aIndex, aMessage);
       
   244     }
       
   245 
       
   246 TInt RCbsUi::FindMessageByHandle( 
       
   247     const TCbsMessageHandle&    aHandle, 
       
   248     TCbsMessage&                aMessage )
       
   249     {
       
   250     return iServer.FindMessageByHandle(aHandle, aMessage);
       
   251     }
       
   252 
       
   253 TInt RCbsUi::GetMessageIndexByHandle( 
       
   254     const TCbsMessageHandle& aHandle, TInt& aIndex )
       
   255     {
       
   256     return iServer.GetMessageIndexByHandle(aHandle, aIndex);
       
   257     }
       
   258 
       
   259 TInt RCbsUi::DeleteMessage( 
       
   260     const TCbsMessageHandle&    aHandle )
       
   261     {    
       
   262     return iServer.DeleteMessage(aHandle);
       
   263     }
       
   264 
       
   265 TInt RCbsUi::SaveMessage( 
       
   266     const TCbsMessageHandle&    aHandle )
       
   267     {    
       
   268     return iServer.SaveMessage(aHandle);
       
   269     }
       
   270 
       
   271 TInt RCbsUi::LockMessage( 
       
   272     const TCbsMessageHandle&    aHandle )
       
   273     {    
       
   274     return iServer.LockMessage(aHandle);
       
   275     }
       
   276 
       
   277 TInt RCbsUi::ReadMessage( 
       
   278     const TCbsMessageHandle&    aHandle )
       
   279     {
       
   280     return iServer.ReadMessage(aHandle);
       
   281     }
       
   282 
       
   283 TInt RCbsUi::GetMessageContents( 
       
   284     const TCbsMessageHandle&    aHandle, 
       
   285     TDes&                       aBuffer )
       
   286     {
       
   287     return iServer.GetMessageContents(aHandle, aBuffer);
       
   288     }
       
   289 
       
   290 TInt RCbsUi::GetNextAndPrevMessageHandle(
       
   291 	const TCbsMessageHandle& aCurrentMsgHandle,
       
   292 	TCbsMessageHandle& aPrevMsgHandle,
       
   293 	TCbsMessageHandle& aNextMsgHandle,
       
   294 	TInt& aPosition )
       
   295     {
       
   296     return iServer.GetNextAndPrevMessageHandle(
       
   297         aCurrentMsgHandle, aPrevMsgHandle, aNextMsgHandle, aPosition);
       
   298     }
       
   299 
       
   300 TBool RCbsUi::Connected() const 
       
   301     {
       
   302     return iServer.Connected();   
       
   303     }
       
   304 
       
   305 void RCbsUi::Shutdown() const
       
   306     {
       
   307     iServer.Shutdown();
       
   308     }
       
   309 
       
   310 //  End of File