File indexing completed on 2024-04-28 04:37:00
0001 /* 0002 SPDX-FileCopyrightText: 2007 Dukju Ahn <dukjuahn@gmail.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_IOUTPUTVIEWMODEL_H 0008 #define KDEVPLATFORM_IOUTPUTVIEWMODEL_H 0009 0010 #include "outputviewexport.h" 0011 0012 #include <QObject> 0013 0014 class QModelIndex; 0015 0016 namespace KDevelop 0017 { 0018 0019 class KDEVPLATFORMOUTPUTVIEW_EXPORT IOutputViewModel 0020 { 0021 public: 0022 virtual ~IOutputViewModel(); 0023 0024 /** 0025 * Called when the index @arg index was activated in output view. 0026 */ 0027 virtual void activate( const QModelIndex& index ) = 0; 0028 0029 /** 0030 * Called when the user wants to see first item. For example, in makebuilder it would be 0031 * first error spot. 0032 * 0033 * @return First model index that is to be highlighted and activated. 0034 * Return invalid index if no appropriate item to highlight exists. 0035 */ 0036 virtual QModelIndex firstHighlightIndex() = 0; 0037 0038 /** 0039 * Called when the user wants to see next item. For example, in makebuilder it would be 0040 * next error spot. In subversion plugin it would be the next conflicted item. 0041 * 0042 * @param currentIndex Currently selected index in active outputview. It can be invalid index 0043 * if no item is selected or highlighted. 0044 * @return Next model index that is to be highlighted and activated. 0045 * Return invalid index if no appropriate item to highlight exists. 0046 */ 0047 virtual QModelIndex nextHighlightIndex( const QModelIndex& currentIndex ) = 0; 0048 0049 /** 0050 * Called when the user wants to see previous item. For example, in makebuilder it would be 0051 * previous error spot. In subversion plugin it would be the previous conflicted item. 0052 * 0053 * @param currentIndex Currently selected index in active outputview. It can be invalid index 0054 * if no item is selected or highlighted. 0055 * @return Previous model index that is to be highlighted and activated. 0056 * Return invalid index if no appropriate item to highlight exists. 0057 */ 0058 virtual QModelIndex previousHighlightIndex( const QModelIndex& currentIndex ) = 0; 0059 0060 /** 0061 * Called when the user wants to see last item. For example, in makebuilder it would be 0062 * last error spot. 0063 * 0064 * @return Last model index that is to be highlighted and activated. 0065 * Return invalid index if no appropriate item to highlight exists. 0066 */ 0067 virtual QModelIndex lastHighlightIndex() = 0; 0068 0069 }; 0070 0071 } 0072 0073 Q_DECLARE_INTERFACE(KDevelop::IOutputViewModel, "org.kdevelop.IOutputViewModel") 0074 0075 #endif 0076