• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

CodeGenerationPolicy Class Reference

#include <codegenerationpolicy.h>

Inheritance diagram for CodeGenerationPolicy:

Inheritance graph
[legend]

List of all members.


Detailed Description

class CodeGenerationPolicy This class describes the code generation policy for this project.

Definition at line 36 of file codegenerationpolicy.h.


Public Types

enum  OverwritePolicy { Ok = 0, Ask, Never, Cancel }
enum  ModifyNamePolicy { No = 0, Underscore, Capitalise }
enum  NewLineType { UNIX = 0, DOS, MAC }
enum  IndentationType { NONE = 0, TAB, SPACE }
enum  CommentStyle { SingleLine = 0, MultiLine }

Signals

void modifiedCodeContent ()

Public Member Functions

 CodeGenerationPolicy (CodeGenerationPolicy *clone)
 CodeGenerationPolicy ()
virtual ~CodeGenerationPolicy ()
void setOverwritePolicy (OverwritePolicy new_var)
OverwritePolicy getOverwritePolicy () const
void setCodeVerboseSectionComments (bool new_var)
bool getCodeVerboseSectionComments () const
void setCodeVerboseDocumentComments (bool new_var)
bool getCodeVerboseDocumentComments () const
void setHeadingFileDir (const QString &path)
QString getHeadingFileDir () const
void setIncludeHeadings (bool new_var)
bool getIncludeHeadings () const
void setOutputDirectory (QDir new_var)
QDir getOutputDirectory ()
void setLineEndingType (NewLineType new_var)
NewLineType getLineEndingType ()
QString getNewLineEndingChars () const
void setIndentationType (IndentationType type)
IndentationType getIndentationType ()
void setIndentationAmount (int amount)
int getIndentationAmount ()
QString getIndentation () const
void setModifyPolicy (ModifyNamePolicy new_var)
ModifyNamePolicy getModifyPolicy () const
void setAutoGenerateConstructors (bool var)
bool getAutoGenerateConstructors ()
void setAttributeAccessorScope (Uml::Visibility::Value var)
Uml::Visibility::Value getAttributeAccessorScope ()
void setAssociationFieldScope (Uml::Visibility::Value var)
Uml::Visibility::Value getAssociationFieldScope ()
virtual CodeGenerationPolicyPage * createPage (QWidget *parent=0, const char *name=0)
QString getHeadingFile (const QString &str)
virtual void setDefaults (CodeGenerationPolicy *defaults, bool emitUpdateSignal=true)
virtual void setDefaults (bool emitUpdateSignal=true)
virtual void writeConfig ()
void emitModifiedCodeContentSig ()
void setCommentStyle (CommentStyle new_var)
CommentStyle getCommentStyle ()

Protected Member Functions

void calculateIndentation ()

Protected Attributes

QString m_lineEndingChars
QString m_indentation

Member Enumeration Documentation

enum CodeGenerationPolicy::OverwritePolicy

OverwritePolicy can have the following values

  • Ok: if there is a file named the same as what you want to name your output file, you can overwrite the old file.

  • Ask:if there is a file named the same as what you want to name your output file, you should ask the User what to do, and give him the option to overwrite the file write the code to a different file, or to abort the generation of this class.
  • Never: you cannot overwrite any files. Generates a new file name like "fileName1.h", "fileName2.h" until you find an appropriate name.
  • Cancel: Do not output anything. This is only set if the user chooses Apply to All Remaining Files and clicks on Do not Output in the Ask dialog
Enumerator:
Ok 
Ask 
Never 
Cancel 

Definition at line 52 of file codegenerationpolicy.h.

enum CodeGenerationPolicy::ModifyNamePolicy

Enumerator:
No 
Underscore 
Capitalise 

Definition at line 53 of file codegenerationpolicy.h.

enum CodeGenerationPolicy::NewLineType

Enumerator:
UNIX 
DOS 
MAC 

Definition at line 54 of file codegenerationpolicy.h.

enum CodeGenerationPolicy::IndentationType

Enumerator:
NONE 
TAB 
SPACE 

Definition at line 55 of file codegenerationpolicy.h.

enum CodeGenerationPolicy::CommentStyle

Enumerator:
SingleLine 
MultiLine 

Definition at line 56 of file codegenerationpolicy.h.


Constructor & Destructor Documentation

CodeGenerationPolicy::CodeGenerationPolicy ( CodeGenerationPolicy *  clone  ) 

Constructor.

Definition at line 48 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::CodeGenerationPolicy (  ) 

Definition at line 57 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::~CodeGenerationPolicy (  )  [virtual]

Empty Destructor.

Definition at line 62 of file codegenerationpolicy.cpp.


Member Function Documentation

void CodeGenerationPolicy::setOverwritePolicy ( OverwritePolicy  new_var  ) 

Set the value of m_overwritePolicy Policy of how to deal with overwriting existing files.

OverwritePolicy can have the following values

  • Ok: if there is a file named the same as what you want to name your output file, you can overwrite the old file.
  • Ask:if there is a file named the same as what you want to name your output file, you should ask the User what to do, and give him the option to overwrite the file write the code to a different file, or to abort the generation of this class.
  • Never: you cannot overwrite any files. Generates a new file name like "fileName1.h", "fileName2.h" until you find an appropriate name.
  • Cancel: Do not output anything. This is only set if the user chooses Apply to All Remaining Files and clicks on Do not Output in the Ask dialog

Parameters:
new_var the new value of m_overwritePolicy
Allowed values are "ask", "yes" and "no".
Parameters:
new_var the new value of m_overwritePolicy

Definition at line 82 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::OverwritePolicy CodeGenerationPolicy::getOverwritePolicy (  )  const

Get the value of m_overwritePolicy Policy of how to deal with overwriting existing files.

Allowed values are "Ok", "Ask", "Never" "Cancel".

Returns:
the value of m_overwritePolicy
Allowed values are "ask", "yes" and "no".
Returns:
the value of m_overwritePolicy

Definition at line 92 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setCodeVerboseSectionComments ( bool  new_var  ) 

Set the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is desired.

If true, comments for sections will be written even if the section is empty.

Parameters:
new_var the new value of m_codeVerboseSectionComments

Definition at line 119 of file codegenerationpolicy.cpp.

bool CodeGenerationPolicy::getCodeVerboseSectionComments (  )  const

Get the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is desired.

If true, comments for sections will be written even if the section is empty.

Returns:
the value of m_codeVerboseSectionComments

Definition at line 130 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setCodeVerboseDocumentComments ( bool  new_var  ) 

Set the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentation is desired.

If true, documentation for various code will be written even if no code would normally be created at that point in the file.

Parameters:
new_var the new value of m_codeVerboseDocumentComments

Definition at line 141 of file codegenerationpolicy.cpp.

bool CodeGenerationPolicy::getCodeVerboseDocumentComments (  )  const

Get the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentation is desired.

If true, documentation for various code will be written even if no code would normally be created at that point in the file.

Returns:
the value of m_codeVerboseDocumentComments

Definition at line 153 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setHeadingFileDir ( const QString &  path  ) 

Set the value of m_headingFileDir location of the header file template.

Parameters:
path the new path of m_headingFileDir
new_var the new value of m_headingFileDir

Definition at line 162 of file codegenerationpolicy.cpp.

QString CodeGenerationPolicy::getHeadingFileDir (  )  const

Get the value of m_headingFileDir location of the header file template.

Returns:
the value of m_headingFileDir

Definition at line 171 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setIncludeHeadings ( bool  new_var  ) 

Set the value of m_includeHeadings.

Parameters:
new_var the new value of m_includeHeadings

Definition at line 179 of file codegenerationpolicy.cpp.

bool CodeGenerationPolicy::getIncludeHeadings (  )  const

Get the value of m_includeHeadings.

Returns:
the value of m_includeHeadings

Definition at line 188 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setOutputDirectory ( QDir  new_var  ) 

Set the value of m_outputDirectory location of where output files will go.

Parameters:
new_var the new value of m_outputDirectory

Definition at line 197 of file codegenerationpolicy.cpp.

QDir CodeGenerationPolicy::getOutputDirectory (  ) 

Get the value of m_outputDirectory location of where output files will go.

Returns:
the value of m_outputDirectory

Definition at line 206 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setLineEndingType ( NewLineType  type  ) 

Set the value of m_lineEndingType What line ending characters to use.

Parameters:
new_var the new value of m_lineEndingType

Definition at line 215 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::NewLineType CodeGenerationPolicy::getLineEndingType (  ) 

Get the value of m_lineEndingType What line ending characters to use.

Returns:
the value of m_lineEndingType

Definition at line 237 of file codegenerationpolicy.cpp.

QString CodeGenerationPolicy::getNewLineEndingChars (  )  const

Utility function to get the actual characters.

Definition at line 243 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setIndentationType ( IndentationType  new_var  ) 

Set the value of m_indentationType The amount and type of whitespace to indent with.

Parameters:
type the new value of m_indentationType
new_var the new value of m_indentationType

Definition at line 252 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::IndentationType CodeGenerationPolicy::getIndentationType (  ) 

Get the value of m_indentationType.

Definition at line 258 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setIndentationAmount ( int  amount  ) 

How many units to indent for each indentation level.

Definition at line 262 of file codegenerationpolicy.cpp.

int CodeGenerationPolicy::getIndentationAmount (  ) 

Definition at line 271 of file codegenerationpolicy.cpp.

QString CodeGenerationPolicy::getIndentation (  )  const

Get the string representation of each level of indentation.

Utility method to get the amount (and type of whitespace) to indent with.

The amount and type of whitespace to indent with.

Returns:
the value of m_indentationType

the value of the indentation

Definition at line 279 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setModifyPolicy ( ModifyNamePolicy  new_var  ) 

Set the value of m_modifyPolicy.

Parameters:
new_var the new value of m_modifyPolicy

Definition at line 306 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::ModifyNamePolicy CodeGenerationPolicy::getModifyPolicy (  )  const

Get the value of m_modifyPolicy.

Returns:
the value of m_modifyPolicy

Definition at line 314 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setAutoGenerateConstructors ( bool  var  ) 

Set the value of m_autoGenerateConstructors.

Parameters:
var the new value
new_var the new value

Definition at line 322 of file codegenerationpolicy.cpp.

bool CodeGenerationPolicy::getAutoGenerateConstructors (  ) 

Get the value of m_autoGenerateConstructors.

Returns:
value the boolean value of m_autoGenerateConstructors

the value of m_autoGenerateConstructors

Definition at line 331 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setAttributeAccessorScope ( Uml::Visibility::Value  var  ) 

Set the value of m_attributeAccessorScope.

Parameters:
var the new value

Definition at line 335 of file codegenerationpolicy.cpp.

Uml::Visibility::Value CodeGenerationPolicy::getAttributeAccessorScope (  ) 

Get the value of m_attributeAccessorScope.

Returns:
the Visibility value of m_attributeAccessorScope

Definition at line 340 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setAssociationFieldScope ( Uml::Visibility::Value  var  ) 

Set the value of m_associationFieldScope.

Parameters:
var the new value

Definition at line 344 of file codegenerationpolicy.cpp.

Uml::Visibility::Value CodeGenerationPolicy::getAssociationFieldScope (  ) 

Get the value of m_associationFieldScope.

Returns:
the Visibility value of m_associationFieldScope

Definition at line 349 of file codegenerationpolicy.cpp.

CodeGenerationPolicyPage * CodeGenerationPolicy::createPage ( QWidget *  pWidget = 0,
const char *  name = 0 
) [virtual]

Create a new dialog interface for this object.

Returns:
dialog object

Definition at line 357 of file codegenerationpolicy.cpp.

QString CodeGenerationPolicy::getHeadingFile ( const QString &  str  ) 

Gets the heading file (as a string) to be inserted at the beginning of the generated file.

you give the file type as parameter and get the string. if fileName starts with a period (.) then fileName is the extension (.cpp, .h, .java) if fileName starts with another character you are requesting a specific file (mylicensefile.txt). The files can have parameters which are denoted by parameter%.

current parameters are author% date% time% filepath%

Definition at line 464 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setDefaults ( CodeGenerationPolicy *  defaults,
bool  emitUpdateSignal = true 
) [virtual]

set the defaults for this code generator from the passed generator.

Definition at line 369 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setDefaults ( bool  emitUpdateSignal = true  )  [virtual]

set the defaults from a config file

Definition at line 398 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::writeConfig (  )  [virtual]

write Default params .

Definition at line 440 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::emitModifiedCodeContentSig (  ) 

Definition at line 364 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::setCommentStyle ( CommentStyle  new_var  ) 

Set the value of m_commentStyle.

Parameters:
new_var the new value of m_commentStyle

Definition at line 100 of file codegenerationpolicy.cpp.

CodeGenerationPolicy::CommentStyle CodeGenerationPolicy::getCommentStyle (  ) 

Get the value of m_commentStyle.

Returns:
the value of m_commentStyle

Definition at line 109 of file codegenerationpolicy.cpp.

void CodeGenerationPolicy::modifiedCodeContent (  )  [signal]

void CodeGenerationPolicy::calculateIndentation (  )  [protected]

Definition at line 283 of file codegenerationpolicy.cpp.


Member Data Documentation

QString CodeGenerationPolicy::m_lineEndingChars [protected]

Definition at line 361 of file codegenerationpolicy.h.

QString CodeGenerationPolicy::m_indentation [protected]

Definition at line 362 of file codegenerationpolicy.h.


The documentation for this class was generated from the following files:
  • codegenerationpolicy.h
  • codegenerationpolicy.cpp

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kate
  •     kate
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal