182 qFatal(
"QCopChannel: Must construct a QApplication " 183 "before QCopChannel");
195 if (it != qcopClientMap->
end()) {
196 it.
value().append(
this);
217 iter != qcopClientMap->
end();
237 it.
value().removeAll(
this);
239 if (it.
value().isEmpty()) {
323 bool known = e->
message ==
"known";
336 return send(channel, msg, data);
371 qFatal(
"QCopChannel::send: Must construct a QApplication " 372 "before using QCopChannel");
398 qFatal(
"QCopChannel::flush: Must construct a QApplication " 399 "before using QCopChannel");
412 void emitNewChannel(
const QString& channel);
413 void emitRemovedChannel(
const QString& channel);
416 void newChannel(
const QString& channel);
417 void removedChannel(
const QString& channel);
421 emit newChannel(channel);
425 emit removedChannel(channel);
443 if (it == qcopServerMap->
end())
450 if (!qcopServerRegexpList)
452 qcopServerRegexpList->
append( item );
456 if (it.value().count() == 0) {
463 it.value().append(cl);
480 for (; it != qcopServerMap->
end(); ++
it) {
481 if (it.value().contains(cl)) {
482 it.value().removeAll(cl);
484 if (it.value().count() == 0) {
493 if (!qcopServerRegexpList)
497 while(it2 != qcopServerRegexpList->
end()) {
498 if ((*it2).client == cl)
499 it2 = qcopServerRegexpList->
erase(it2);
523 bool known = qcopServerMap && qcopServerMap->
contains(c)
524 && !((*qcopServerMap)[
c]).
isEmpty();
536 if (it != qcopServerMap->
end()) {
538 it.value().removeAll(cl);
539 if (it.value().isEmpty()) {
545 qcopServerMap->
erase(it);
551 = qcopServerRegexpList->
begin();
552 while(it != qcopServerRegexpList->
end()) {
553 if ((*it).client == cl && (*it).channel == c)
554 it = qcopServerRegexpList->
erase(it);
569 for (
int i=0; i < clist.
size(); ++i) {
578 for (; it != qcopServerRegexpList->
constEnd(); ++
it) {
579 if ((*it).regexp.exactMatch(ch)) {
590 ((*it).client, (*it).channel,
591 QLatin1String(
"forwardedMessage(QString,QString,QByteArray)"),
619 clients = (*qcopClientMap)[ch];
621 for (
int i = 0; i < clients.
size(); ++i) {
630 #include "qcopchannel_qws.moc"
void emitNewChannel(const QString &channel)
void registerChannel(const QString &channel)
#define QT_END_NAMESPACE
This macro expands to.
static bool flush()
Flushes all queued messages to the registered listeners.
The QMutex class provides access serialization between threads.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
static void sendQCopEvent(QWSClient *c, const QString &ch, const QString &msg, const QByteArray &data, bool response=false)
The QRegExp class provides pattern matching using regular expressions.
static QCopServerRegexpList * qcopServerRegexpList
#define it(className, varName)
Q_GUI_EXPORT QWSDisplay * qt_fbdpy
The QByteArray class provides an array of bytes.
void emitRemovedChannel(const QString &channel)
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static bool send(const QString &channel, const QString &msg)
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
void received(const QString &msg, const QByteArray &data)
This signal is emitted whenever this object's channel receives new messages (i.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
void init(const QString &channel)
QWSQCopMessageEvent * waitForQCopResponse()
The QPointer class is a template class that provides guarded pointers to QObject. ...
void setObjectName(const QString &name)
static void sendLocally(const QString &ch, const QString &msg, const QByteArray &data)
Client side: distribute received event to the QCop instance managing the channel. ...
T & value() const
Returns a modifiable reference to the current item's value.
QMap< QString, QList< QWSClient * > > QCopServerMap
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
const T value(const Key &key) const
Returns the value associated with the key key.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
iterator Iterator
Qt-style synonym for QMap::iterator.
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
static bool containsWildcards(const QString &channel)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static void answer(QWSClient *cl, const QString &ch, const QString &msg, const QByteArray &data)
Server side: transmit the message to all clients registered to the specified channel.
QString channel() const
Returns the name of this object's channel.
static void detach(QWSClient *cl)
Server side: unsubscribe cl from all channels.
static QCopClientMap * qcopClientMap
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
iterator begin()
Returns an STL-style iterator pointing to the first item in the map.
int remove(const Key &key)
Removes all the items that have the key key from the map.
Q_CORE_EXPORT void qFatal(const char *,...)
iterator erase(iterator pos)
Removes the item associated with the iterator pos from the list, and returns an iterator to the next ...
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
The QMap::iterator class provides an STL-style non-const iterator for QMap and QMultiMap.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
QObject * parent() const
Returns a pointer to the parent object.
QMap< QString, QList< QPointer< QCopChannel > > > QCopClientMap
int size() const
Returns the number of items in the list.
QCopServerRegexp(const QString &channel, QWSClient *client)
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
static QCopServerMap * qcopServerMap
The QCopChannel class provides communication capabilities between clients in Qt for Embedded Linux...
iterator erase(iterator it)
Removes the (key, value) pair pointed to by the iterator pos from the map, and returns an iterator to...
virtual ~QCopChannel()
Destroys this QCopChannel object.
The QDataStream class provides serialization of binary data to a QIODevice.
virtual void receive(const QString &msg, const QByteArray &data)
Processes the incoming message and data.
static void registerChannel(const QString &ch, QWSClient *cl)
Server side: subscribe client cl on channel ch.
QList< QCopServerRegexp > QCopServerRegexpList
#define qPrintable(string)
QCopChannel(const QString &channel, QObject *parent=0)
Constructs a QCopChannel object for the specified channel, with the given parent. ...
The QWSClient class encapsulates a client process in Qt for Embedded Linux.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
The QMap class is a template class that provides a skip-list-based dictionary.
QWSServer Q_GUI_EXPORT * qwsServer
void sendMessage(const QString &channel, const QString &msg, const QByteArray &data)
The QList class is a template class that provides lists.
static bool isRegistered(const QString &channel)
Queries the server for the existence of the given channel.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
static void reregisterAll()