~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/devicemodel/hactioninvoke_callback.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-09-27 21:41:30 UTC
  • mfrom: (1.2.43)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20120927214130-i8v3ufr21nesp29i
Tags: 4:3.0.0~beta1a-1
* New upstream release

* Fix "wrongly conflicts phonon-backend-vlc" dropped (Closes: #688142)
* debian/watch include download.kde.org

* digikam 3.0.0 uses features from unreleased kdegraphics >=4.10 & ships 
a private version of the kdegraphics libs - this is not the Debian way :-(
* Unsatisfactory Conflicts: libkipi8, libkexiv2-10, libkdcraw20, libksane0
* Suspend digikam-dbg >130Mb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP (HUPnP) library.
 
7
 *
 
8
 *  Herqq UPnP is free software: you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU Lesser General Public License as published by
 
10
 *  the Free Software Foundation, either version 3 of the License, or
 
11
 *  (at your option) any later version.
 
12
 *
 
13
 *  Herqq UPnP is distributed in the hope that it will be useful,
 
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
16
 *  GNU Lesser General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU Lesser General Public License
 
19
 *  along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#ifndef HACTIONINVOKE_CALLBACK_H_
 
23
#define HACTIONINVOKE_CALLBACK_H_
 
24
 
 
25
#include <HUpnpCore/HUpnp>
 
26
#include <HUpnpCore/HFunctor>
 
27
 
 
28
/*!
 
29
 * \file
 
30
 */
 
31
 
 
32
namespace Herqq
 
33
{
 
34
 
 
35
namespace Upnp
 
36
{
 
37
 
 
38
/*!
 
39
 * This is a type definition for a <em>callable entity</em> that is used
 
40
 * as a callback for signaling the completion of an HClientAction invocation.
 
41
 *
 
42
 * You can create \c %HActionInvokeCallback objects using normal functions,
 
43
 * functors and member functions that follow the signature of
 
44
 *
 
45
 * <tt>
 
46
 *
 
47
 * bool function(Herqq::Upnp::HClientAction*, const Herqq::Upnp::HClientActionOp&);
 
48
 *
 
49
 * </tt>
 
50
 *
 
51
 * <h3>Parameters</h3>
 
52
 * \li The first parameter is a type of an "ID" of the asynchronous action invocation.
 
53
 * \li The second parameter specifies the output arguments of the action invocation,
 
54
 * which may be empty.
 
55
 *
 
56
 * <h3>Return value</h3>
 
57
 * The return value indicates if the invoked HClientAction should emit an
 
58
 * HClientAction::invokeComplete() after the callback has returned.
 
59
 * \li \b true indicates that the HClientAction should sent the corresponding event.
 
60
 *
 
61
 * The following example demonstrates how you can instantiate the \c %HActionInvokeCallback
 
62
 * for a normal function, functor and a member function.
 
63
 *
 
64
 * \code
 
65
 *
 
66
 * #include <HUpnpCore/HClientAction>
 
67
 *
 
68
 * #include "myclass.h" // your code that contains declaration for MyClass
 
69
 *
 
70
 * namespace
 
71
 * {
 
72
 * bool freefun(Herqq::Upnp::HClientAction*, const Herqq::Upnp::HClientActionOp&)
 
73
 * {
 
74
 *     return true;
 
75
 * }
 
76
 *
 
77
 * class MyFunctor
 
78
 * {
 
79
 * public:
 
80
 *     bool operator()(Herqq::Upnp::HClientAction*, const Herqq::Upnp::HClientActionOp&)
 
81
 *     {
 
82
 *         return true;
 
83
 *     }
 
84
 * };
 
85
 * }
 
86
 *
 
87
 * bool MyClass::memfun(Herqq::Upnp::HClientAction*, const Herqq::Upnp::HClientActionOp&)
 
88
 * {
 
89
 *     return true;
 
90
 * }
 
91
 *
 
92
 * void MyClass::example()
 
93
 * {
 
94
 *     Herqq::Upnp::HActionInvokeCallback usingFreeFunction(freefun);
 
95
 *
 
96
 *     MyFunctor myfunc;
 
97
 *     Herqq::Upnp::HActionInvokeCallback usingFunctor(myfunc);
 
98
 *
 
99
 *     Herqq::Upnp::HActionInvokeCallback usingMemberFunction(this, &MyClass::memfun);
 
100
 * }
 
101
 *
 
102
 * \endcode
 
103
 *
 
104
 * You can test if the object can be invoked simply by issuing
 
105
 * <tt>if (actionInvokeCallbackObject) { ... } </tt>
 
106
 *
 
107
 * \headerfile hactioninvoke_callback.h HActionInvokeCallback
 
108
 *
 
109
 * \ingroup hupnp_devicemodel
 
110
 */
 
111
typedef Functor<bool, H_TYPELIST_2(
 
112
    HClientAction*, const HClientActionOp&)> HActionInvokeCallback;
 
113
 
 
114
}
 
115
}
 
116
 
 
117
#endif /* HACTIONINVOKE_CALLBACK_H_ */