Warning, /frameworks/ktexteditor/docs/coding-guidelines.dox is written in an unsupported language. File is not indexed.
0001 /** \page kte_guidelines Coding Guidelines and API Conventions 0002 0003 <p><b> 0004 \ref index "Overview" | 0005 \ref kte_design "Design" | 0006 Coding Guidelines | 0007 \ref kte_port_to_5 "Porting to KDE Frameworks 5" 0008 </b></p> 0009 0010 All KTextEditor interfaces have a consistent design. 0011 - naming follows Qt style. Avoid Java style getters like getSomeData() 0012 for example, 0013 - core interfaces (see \ref kte_design) which inherit QObject declare all 0014 signals as real signals, 0015 - all other interfaces, which do not subclass QObject, must declare their 0016 signals as virtual private member functions. An implementation must 0017 reimplement this virtual member function as a real signal. 0018 - all signals have the sender object as first parameter, for example 0019 all document signals have to look like this: 0020 \code 0021 void signalFromDocument (KTextEditor::Document *doc, ...); 0022 \endcode 0023 This allows easy and consistent query which object did send the signal, 0024 which is important for most applications, as they listen to multiple 0025 documents/views/editors/... 0026 - all interface functions should be virtual, to allow subclasses to 0027 overwrite them, most members should even be pure virtual, beside 0028 additional convenience/helper functions. 0029 0030 The interface KTextEditor::Cursor represents a cursor position, i.e. a 0031 line/column tuple. The same holds for KTextEditor::Range. As both of this 0032 concepts are much cleaner than tuples, please keep the following guidelines: 0033 - never use line/column tuples in parameter lists, use KTextEditor::Cursor 0034 instead, 0035 - never use Cursor/Cursor tuples for ranges, use KTextEditor::Range 0036 instead of two Cursors. 0037 0038 \author Christoph Cullmann \<email@example.com\> 0039 \author Dominik Haumann \<firstname.lastname@example.org\> 0040 */