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