[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs
From:       Anders Lund <anders () alweb ! dk>
Date:       2007-10-04 9:09:29
Message-ID: 1191488969.110635.27345.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 720996 by alund:

Add functions to return the section of a highlight-mode or mode, given its index in \
the list returned by highlightModes() or modes(). Approved by Christoph Cullmann.
FEATURE:


 M  +16 -0     interfaces/ktexteditor/document.h  
 M  +10 -0     kate/document/katedocument.cpp  
 M  +15 -0     kate/document/katedocument.h  


--- trunk/KDE/kdelibs/interfaces/ktexteditor/document.h #720995:720996
@@ -629,6 +629,22 @@
      */
     virtual bool setHighlightingMode(const QString &name) = 0;
 
+    /**
+     * Returns the name of the section for a highlight given its index in the \
highlight  +     * list (as returned by highlightModes()).
+     * You can use this function to build a tree of the highlight names, organized \
in sections. +     * \param name the name of the highlight for which to find the \
section name. +     */
+    virtual QString highlightModeSection( int index ) const = 0;
+
+    /**
+     * Returns the name of the section for a mode given its index in the highlight 
+     * list (as returned by modes()).
+     * You can use this function to build a tree of the mode names, organized in \
sections. +     * \param name the name of the highlight for which to find the section \
name. +     */
+    virtual QString modeSection( int index ) const = 0;
+
   /*
    * SIGNALS
    * Following signals should be emitted by the document if the mode
--- trunk/KDE/kdelibs/kate/document/katedocument.cpp #720995:720996
@@ -3014,6 +3014,16 @@
   return hls;
 }
 
+QString KateDocument::highlightModeSection( int index ) const
+{
+  return KateHlManager::self()->hlSection( index );
+}
+
+QString KateDocument::modeSection( int index ) const
+{
+  return KateGlobal::self()->modeManager()->list()[ index ]->section;
+}
+
 void KateDocument::bufferHlChanged ()
 {
   // update all views
--- trunk/KDE/kdelibs/kate/document/katedocument.h #720995:720996
@@ -506,7 +506,22 @@
      * \return \e true on success, otherwise \e false
      */
     virtual bool setHighlightingMode(const QString &name);
+    /**
+     * Returns the name of the section for a highlight given its index in the \
highlight  +     * list (as returned by highlightModes()).
+     * You can use this function to build a tree of the highlight names, organized \
in sections. +     * \param name the name of the highlight for which to find the \
section name. +     */
+    virtual QString highlightModeSection( int index ) const;
 
+    /**
+     * Returns the name of the section for a mode given its index in the highlight 
+     * list (as returned by modes()).
+     * You can use this function to build a tree of the mode names, organized in \
sections. +     * \param name the name of the highlight for which to find the section \
name. +     */
+    virtual QString modeSection( int index ) const;
+
   /*
    * SIGNALS
    * Following signals should be emitted by the document if the mode


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic