contentstorage/caclient/stub/src/caclientnotifierproxy.cpp
author hgs
Wed, 24 Mar 2010 03:15:43 +0200
changeset 89 1e87eb3b400f
parent 87 9d806967057c
child 93 82b66994846c
permissions -rw-r--r--
201011
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
7feec50967db 201003_02
hgs
parents:
diff changeset
     1
/*
7feec50967db 201003_02
hgs
parents:
diff changeset
     2
 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
7feec50967db 201003_02
hgs
parents:
diff changeset
     3
 * All rights reserved.
7feec50967db 201003_02
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
7feec50967db 201003_02
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
7feec50967db 201003_02
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
7feec50967db 201003_02
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
7feec50967db 201003_02
hgs
parents:
diff changeset
     8
 *
7feec50967db 201003_02
hgs
parents:
diff changeset
     9
 * Initial Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
7feec50967db 201003_02
hgs
parents:
diff changeset
    11
 *
7feec50967db 201003_02
hgs
parents:
diff changeset
    12
 * Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    13
 *
7feec50967db 201003_02
hgs
parents:
diff changeset
    14
 * Description:
7feec50967db 201003_02
hgs
parents:
diff changeset
    15
 *
7feec50967db 201003_02
hgs
parents:
diff changeset
    16
 */
7feec50967db 201003_02
hgs
parents:
diff changeset
    17
7feec50967db 201003_02
hgs
parents:
diff changeset
    18
#include <QDebug>
7feec50967db 201003_02
hgs
parents:
diff changeset
    19
#include <QMutexLocker>
7feec50967db 201003_02
hgs
parents:
diff changeset
    20
7feec50967db 201003_02
hgs
parents:
diff changeset
    21
#include "caclientnotifierproxy.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    22
#include "caentry.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    23
#include "caobjectadapter.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    24
#include "canotifiers.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    25
7feec50967db 201003_02
hgs
parents:
diff changeset
    26
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    27
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    28
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    29
CaClientNotifierProxy::CaClientNotifierProxy(QObject *parent) :
7feec50967db 201003_02
hgs
parents:
diff changeset
    30
    QObject(parent)
7feec50967db 201003_02
hgs
parents:
diff changeset
    31
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    32
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    33
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    34
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    35
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    36
CaClientNotifierProxy::~CaClientNotifierProxy()
7feec50967db 201003_02
hgs
parents:
diff changeset
    37
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    38
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    39
7feec50967db 201003_02
hgs
parents:
diff changeset
    40
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    41
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    42
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    43
void CaClientNotifierProxy::entryChanged(int entryId,
87
hgs
parents: 85
diff changeset
    44
        ChangeType changeType) const
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    45
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    46
    qDebug() << "CaClientProxy::entryChanged entryId:"
87
hgs
parents: 85
diff changeset
    47
             << entryId << "changeType:" << changeType;
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    48
    emit signalEntryChanged(entryId, changeType);
7feec50967db 201003_02
hgs
parents:
diff changeset
    49
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    50
7feec50967db 201003_02
hgs
parents:
diff changeset
    51
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    52
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    53
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    54
void CaClientNotifierProxy::entryChanged(const CaEntry &entry,
87
hgs
parents: 85
diff changeset
    55
        ChangeType changeType) const
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    56
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    57
    qDebug() << "CaClientProxy::entryChanged changeType:" << changeType;
7feec50967db 201003_02
hgs
parents:
diff changeset
    58
    CaEntry *caEntry = new CaEntry(entry);
7feec50967db 201003_02
hgs
parents:
diff changeset
    59
    emit signalEntryChanged(*caEntry, changeType);
7feec50967db 201003_02
hgs
parents:
diff changeset
    60
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    61
7feec50967db 201003_02
hgs
parents:
diff changeset
    62
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    63
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    64
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    65
void CaClientNotifierProxy::entryTouched(int id) const
7feec50967db 201003_02
hgs
parents:
diff changeset
    66
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    67
    qDebug() << "CaClientProxy::entryTouched id:" << id;
7feec50967db 201003_02
hgs
parents:
diff changeset
    68
    emit signalEntryTouched(id);
7feec50967db 201003_02
hgs
parents:
diff changeset
    69
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    70
7feec50967db 201003_02
hgs
parents:
diff changeset
    71
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    72
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    73
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    74
void CaClientNotifierProxy::groupContentChanged(int groupId) const
7feec50967db 201003_02
hgs
parents:
diff changeset
    75
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    76
    qDebug() << "CaClientProxy::groupContentChanged groupId:" << groupId;
7feec50967db 201003_02
hgs
parents:
diff changeset
    77
    emit signalGroupContentChanged(groupId);
7feec50967db 201003_02
hgs
parents:
diff changeset
    78
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    79
7feec50967db 201003_02
hgs
parents:
diff changeset
    80
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    81
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    82
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    83
int CaClientNotifierProxy::registerNotifier(
7feec50967db 201003_02
hgs
parents:
diff changeset
    84
    const CaNotifierFilter *notifierFilter,
7feec50967db 201003_02
hgs
parents:
diff changeset
    85
    CaNotifierPrivate::NotifierType notifierType,
7feec50967db 201003_02
hgs
parents:
diff changeset
    86
    const CaClientNotifierProxy *notifierProxy)
7feec50967db 201003_02
hgs
parents:
diff changeset
    87
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    88
    qDebug() << "CaClientProxy::registerNotifier notifierType:"
87
hgs
parents: 85
diff changeset
    89
             << notifierType;
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    90
    QMutexLocker locker(&mMutex);
7feec50967db 201003_02
hgs
parents:
diff changeset
    91
    return CaNotifiers::addNotifier(notifierFilter, notifierType, notifierProxy);
7feec50967db 201003_02
hgs
parents:
diff changeset
    92
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    93
7feec50967db 201003_02
hgs
parents:
diff changeset
    94
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    95
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    96
//----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    97
void CaClientNotifierProxy::unregisterNotifier(
87
hgs
parents: 85
diff changeset
    98
    const CaNotifierFilter &notifierFilter,
hgs
parents: 85
diff changeset
    99
    CaNotifierPrivate::NotifierType notifierType)
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   100
{
7feec50967db 201003_02
hgs
parents:
diff changeset
   101
    qDebug() << "CaClientProxy::unregisterNotifier notifierType:"
87
hgs
parents: 85
diff changeset
   102
             << notifierType;
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   103
    QMutexLocker locker(&mMutex);
7feec50967db 201003_02
hgs
parents:
diff changeset
   104
    CaNotifiers::removeNotifier(&notifierFilter, notifierType);
7feec50967db 201003_02
hgs
parents:
diff changeset
   105
}
7feec50967db 201003_02
hgs
parents:
diff changeset
   106