Qt 4.8
Classes | Public Functions | Public Variables | List of all members
QWSQCopSendCommand Struct Reference

#include <qwscommand_qws_p.h>

Inheritance diagram for QWSQCopSendCommand:
QWSCommand QWSProtocolItem

Classes

struct  SimpleData
 

Public Functions

 QWSQCopSendCommand ()
 
void setData (const char *d, int len, bool allocateMem)
 
void setMessage (const QString &c, const QString &m, const QByteArray &data)
 
- Public Functions inherited from QWSCommand
 QWSCommand (int t, int len, char *ptr)
 
- Public Functions inherited from QWSProtocolItem
void copyFrom (const QWSProtocolItem *item)
 
 QWSProtocolItem (int t, int len, char *ptr)
 
bool read (QIODevice *s)
 
void write (QIODevice *s)
 
virtual ~QWSProtocolItem ()
 

Public Variables

QString channel
 
QByteArray data
 
QString message
 
struct QWSQCopSendCommand::SimpleData simpleData
 
- Public Variables inherited from QWSProtocolItem
int bytesRead
 
bool deleteRaw
 
char * rawDataPtr
 
int rawLen
 
char * simpleDataPtr
 
int simpleLen
 
int type
 

Additional Inherited Members

- Public Types inherited from QWSCommand
enum  Type {
  Unknown = 0, Create, Shutdown, Region,
  RegionMove, RegionDestroy, SetProperty, AddProperty,
  RemoveProperty, GetProperty, SetSelectionOwner, ConvertSelection,
  RequestFocus, ChangeAltitude, SetOpacity, DefineCursor,
  SelectCursor, PositionCursor, GrabMouse, PlaySound,
  QCopRegisterChannel, QCopSend, RegionName, Identify,
  GrabKeyboard, RepaintRegion, IMMouse, IMUpdate,
  IMResponse, Embed, Font, ScreenTransform
}
 
- Static Public Functions inherited from QWSCommand
static QWSCommandfactory (int type)
 

Detailed Description

Definition at line 631 of file qwscommand_qws_p.h.

Constructors and Destructors

◆ QWSQCopSendCommand()

QWSQCopSendCommand::QWSQCopSendCommand ( )
inline

Definition at line 633 of file qwscommand_qws_p.h.

633  :
635  sizeof(simpleData), reinterpret_cast<char *>(&simpleData)) {}
struct QWSQCopSendCommand::SimpleData simpleData
QWSCommand(int t, int len, char *ptr)

Functions

◆ setData()

void QWSQCopSendCommand::setData ( const char *  d,
int  len,
bool  allocateMem 
)
inlinevirtual

Reimplemented from QWSProtocolItem.

Definition at line 637 of file qwscommand_qws_p.h.

637  {
638  QWSCommand::setData(d, len, allocateMem);
639 
640  if( simpleData.clen * int(sizeof(QChar)) + simpleData.mlen * int(sizeof(QChar)) + simpleData.dlen * int(sizeof(char)) > len )
641  {
642  qWarning( "qcop send command - channel name length %d - message name length %d - data size %d - buffer size %d - buffer overrun!",
644  }
645  else
646  {
647  const QChar *cd = reinterpret_cast<const QChar*>(d);
650  d += simpleData.clen*sizeof(QChar) + simpleData.mlen*sizeof(QChar);
652  }
653  }
double d
Definition: qnumeric_p.h:62
virtual void setData(const char *data, int len, bool allocateMem=true)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
Q_CORE_EXPORT void qWarning(const char *,...)
struct QWSQCopSendCommand::SimpleData simpleData

◆ setMessage()

void QWSQCopSendCommand::setMessage ( const QString c,
const QString m,
const QByteArray data 
)
inline

Definition at line 655 of file qwscommand_qws_p.h.

Referenced by QWSDisplay::sendMessage().

657  {
658  this->channel = c;
659  this->message = m;
660  this->data = data;
661  simpleData.clen = c.length();
662  simpleData.mlen = m.length();
663  simpleData.dlen = data.size();
664  int l = simpleData.clen*sizeof(QChar);
665  l += simpleData.mlen*sizeof(QChar);
666  l += simpleData.dlen;
667  char *tmp = new char[l];
668  char *d = tmp;
669  memcpy(d, c.unicode(), simpleData.clen*sizeof(QChar));
670  d += simpleData.clen*sizeof(QChar);
671  memcpy(d, m.unicode(), simpleData.mlen*sizeof(QChar));
672  d += simpleData.mlen*sizeof(QChar);
673  memcpy(d, data.data(), simpleData.dlen);
674  QWSCommand::setData(tmp, l, false);
675  deleteRaw = true;
676  }
double d
Definition: qnumeric_p.h:62
unsigned char c[8]
Definition: qnumeric_p.h:62
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
virtual void setData(const char *data, int len, bool allocateMem=true)
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
struct QWSQCopSendCommand::SimpleData simpleData
QFactoryLoader * l
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402

Properties

◆ channel

QString QWSQCopSendCommand::channel

◆ data

QByteArray QWSQCopSendCommand::data

Definition at line 685 of file qwscommand_qws_p.h.

Referenced by QWSServerPrivate::invokeQCopSend().

◆ message

QString QWSQCopSendCommand::message

◆ simpleData

struct QWSQCopSendCommand::SimpleData QWSQCopSendCommand::simpleData

The documentation for this struct was generated from the following file: