controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.cpp
author hgs
Fri, 14 May 2010 13:21:08 +0800
changeset 19 36aa4756ee82
parent 11 10d0dd0e43f1
child 21 2883a5458389
permissions -rw-r--r--
201019
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
19
hgs
parents: 11
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents: 11
diff changeset
     3
 * All rights reserved.
hgs
parents: 11
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents: 11
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0""
hgs
parents: 11
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents: 11
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents: 11
diff changeset
     8
 *
hgs
parents: 11
diff changeset
     9
 * Initial Contributors:
hgs
parents: 11
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents: 11
diff changeset
    11
 *
hgs
parents: 11
diff changeset
    12
 * Contributors:
hgs
parents: 11
diff changeset
    13
 *
hgs
parents: 11
diff changeset
    14
 * Description:  
hgs
parents: 11
diff changeset
    15
 *   
hgs
parents: 11
diff changeset
    16
 */
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include "cpthemeclientsymbian_p.h"
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "cpthemesymbiancommon_p.h"
19
hgs
parents: 11
diff changeset
    20
#include <e32property.h>
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
/**
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
* constructor
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
*/
19
hgs
parents: 11
diff changeset
    26
CpThemeClientPrivate::CpThemeClientPrivate()
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
{
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
}
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
/**
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
* CpThemeClientPrivate::connectToServer()
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
*
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
* Connects to the server
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
*/
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
bool CpThemeClientPrivate::connectToServer()
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
{
19
hgs
parents: 11
diff changeset
    37
    return true;
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
}
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
/**
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
Indicates a connection to the server
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
*/
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
bool CpThemeClientPrivate::isConnected()
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
{
19
hgs
parents: 11
diff changeset
    45
    return true;
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
}
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
/**
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
 * Destructor
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
 */
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
CpThemeClientPrivate::~CpThemeClientPrivate()
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
{
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
}
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
/**
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
 * changeTheme
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
 */
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
bool CpThemeClientPrivate::changeTheme(const QString& aString )
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
{
19
hgs
parents: 11
diff changeset
    60
    TInt err = KErrGeneral;
hgs
parents: 11
diff changeset
    61
    RProperty themeRequestProp;
hgs
parents: 11
diff changeset
    62
    
hgs
parents: 11
diff changeset
    63
    User::LeaveIfError( themeRequestProp.Attach( KServerUid3, KNewThemeForThemeChanger ) );
hgs
parents: 11
diff changeset
    64
    
hgs
parents: 11
diff changeset
    65
    TBuf<256> newThemenameChangeRequest;
hgs
parents: 11
diff changeset
    66
    _LIT(KThemeRequestFormatter, "%d:%S");
hgs
parents: 11
diff changeset
    67
    TBuf<256> newThemename(aString.utf16());
hgs
parents: 11
diff changeset
    68
    newThemenameChangeRequest.Format( KThemeRequestFormatter, EThemeSelection, &newThemename);
hgs
parents: 11
diff changeset
    69
    err = themeRequestProp.Set(newThemenameChangeRequest);
hgs
parents: 11
diff changeset
    70
    themeRequestProp.Close();
hgs
parents: 11
diff changeset
    71
    return (err == KErrNone);
11
10d0dd0e43f1 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
}