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

#include <qwscommand_qws_p.h>

Inheritance diagram for QWSRegionNameCommand:
QWSCommand QWSProtocolItem

Classes

struct  SimpleData
 

Public Functions

 QWSRegionNameCommand ()
 
void setData (const char *d, int len, bool allocateMem)
 
void setName (const QString &n, const QString &c)
 
- 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 caption
 
QString name
 
struct QWSRegionNameCommand::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 194 of file qwscommand_qws_p.h.

Constructors and Destructors

◆ QWSRegionNameCommand()

QWSRegionNameCommand::QWSRegionNameCommand ( )
inline

Definition at line 196 of file qwscommand_qws_p.h.

196  :
198  sizeof(simpleData), reinterpret_cast<char *>(&simpleData)) {}
struct QWSRegionNameCommand::SimpleData simpleData
QWSCommand(int t, int len, char *ptr)

Functions

◆ setData()

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

Reimplemented from QWSProtocolItem.

Definition at line 200 of file qwscommand_qws_p.h.

200  {
201  QWSCommand::setData(d, len, allocateMem);
203  {
204  qWarning( "region name command - name length too big!" );
206  }
208  {
209  qWarning( "region name command - caption length too big!" );
211  }
212  if ( simpleData.nameLen + simpleData.captionLen > len )
213  {
214  qWarning( "region name command - name length %d - caption length %d - buffer size %d - buffer overrun!",
216 
217  }
218  else
219  {
220  name = QString(reinterpret_cast<const QChar*>(d), simpleData.nameLen/2);
221  d += simpleData.nameLen;
222  caption = QString(reinterpret_cast<const QChar*>(d), simpleData.captionLen/2);
223  }
224  }
double d
Definition: qnumeric_p.h:62
virtual void setData(const char *data, int len, bool allocateMem=true)
#define MAX_COMMAND_SIZE
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_CORE_EXPORT void qWarning(const char *,...)
struct QWSRegionNameCommand::SimpleData simpleData

◆ setName()

void QWSRegionNameCommand::setName ( const QString n,
const QString c 
)
inline

Definition at line 226 of file qwscommand_qws_p.h.

Referenced by QWSDisplay::nameRegion().

227  {
228  name = n;
229  caption = c;
230  int l = simpleData.nameLen = name.length()*2;
231  l += simpleData.captionLen = caption.length()*2;
232  char *d = new char[l];
233  memcpy(d, name.unicode(), simpleData.nameLen);
235  setData(d, l, true);
236  delete[] d;
237  }
double d
Definition: qnumeric_p.h:62
unsigned char c[8]
Definition: qnumeric_p.h:62
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
void setData(const char *d, int len, bool allocateMem)
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
struct QWSRegionNameCommand::SimpleData simpleData
QFactoryLoader * l

Properties

◆ caption

QString QWSRegionNameCommand::caption

Definition at line 245 of file qwscommand_qws_p.h.

Referenced by QWSServerPrivate::invokeRegionName().

◆ name

QString QWSRegionNameCommand::name

Definition at line 244 of file qwscommand_qws_p.h.

Referenced by QWSServerPrivate::invokeRegionName().

◆ simpleData

struct QWSRegionNameCommand::SimpleData QWSRegionNameCommand::simpleData

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