Show
Ignore:
Timestamp:
04/11/06 10:13:29 (3 years ago)
Author:
jordi
Message:

At last, I have the first presenter's test. At the previous commit I forgot to add the MainPter?.cxx and header filers. Are now included in this commit.

The first check just test that the initial state of the main window is what we expect (i.e., no document yet => all unsensitived).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DumbMainView.cxx

    r21 r23  
    1616// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1717 
     18#include <epdfview.h> 
     19#include "DumbMainView.h" 
     20 
     21using namespace ePDFView; 
     22 
     23//////////////////////////////////////////////////////////////// 
     24// Interface Methods 
     25//////////////////////////////////////////////////////////////// 
     26DumbMainView::DumbMainView (MainPter *pter): 
     27    IMainView (pter) 
     28{ 
     29    // This won't be deleted because it's presenter responsability. 
     30    m_DocumentPage = NULL; 
     31    m_SensitiveGoToFirstPage = TRUE; 
     32    m_SensitiveGoToLastPage = TRUE; 
     33    m_SensitiveGoToNextPage = TRUE; 
     34    m_SensitiveGoToPage = TRUE; 
     35    m_SensitiveGoToPreviousPage = TRUE; 
     36    m_SensitiveZoomIn = TRUE; 
     37    m_SensitiveZoomOut = TRUE; 
     38    m_SensitiveZoomFit = TRUE; 
     39    m_SensitiveZoomWidth = TRUE; 
     40    m_Shown = FALSE; 
     41    m_Title = g_strdup (""); 
     42} 
     43 
     44DumbMainView::~DumbMainView () 
     45{ 
     46    g_free (m_Title); 
     47} 
     48 
     49void 
     50DumbMainView::sensitiveGoToFirstPage (gboolean sensitive) 
     51{ 
     52    m_SensitiveGoToFirstPage = sensitive; 
     53} 
     54 
     55void 
     56DumbMainView::sensitiveGoToLastPage (gboolean sensitive) 
     57{ 
     58    m_SensitiveGoToLastPage = sensitive; 
     59} 
     60 
     61void 
     62DumbMainView::sensitiveGoToNextPage (gboolean sensitive) 
     63{ 
     64    m_SensitiveGoToNextPage = sensitive; 
     65} 
     66 
     67void 
     68DumbMainView::sensitiveGoToPage (gboolean sensitive) 
     69{ 
     70    m_SensitiveGoToPage = sensitive; 
     71} 
     72 
     73void 
     74DumbMainView::sensitiveGoToPreviousPage (gboolean sensitive) 
     75{ 
     76    m_SensitiveGoToPreviousPage = sensitive; 
     77} 
     78 
     79void 
     80DumbMainView::sensitiveZoomIn (gboolean sensitive) 
     81{ 
     82    m_SensitiveZoomIn = sensitive; 
     83} 
     84 
     85void 
     86DumbMainView::sensitiveZoomOut (gboolean sensitive) 
     87{ 
     88    m_SensitiveZoomOut = sensitive; 
     89} 
     90 
     91void 
     92DumbMainView::sensitiveZoomFit (gboolean sensitive) 
     93{ 
     94    m_SensitiveZoomFit = sensitive; 
     95} 
     96 
     97void 
     98DumbMainView::sensitiveZoomWidth (gboolean sensitive) 
     99{ 
     100    m_SensitiveZoomWidth = sensitive; 
     101} 
     102 
     103void 
     104DumbMainView::show (void) 
     105{ 
     106    m_Shown = TRUE; 
     107} 
     108 
     109void 
     110DumbMainView::setTitle (const gchar *title) 
     111{ 
     112    g_free (m_Title); 
     113    m_Title = g_strdup (title); 
     114} 
     115 
     116 
     117//////////////////////////////////////////////////////////////// 
     118// Test Methods 
     119//////////////////////////////////////////////////////////////// 
     120 
     121gboolean 
     122DumbMainView::isShown () 
     123{ 
     124    return m_Shown; 
     125} 
     126 
     127const gchar * 
     128DumbMainView::getTitle () 
     129{ 
     130    return m_Title; 
     131} 
     132 
     133gboolean 
     134DumbMainView::isSensitiveGoToFirstPage () 
     135{ 
     136    return m_SensitiveGoToFirstPage; 
     137} 
     138 
     139gboolean 
     140DumbMainView::isSensitiveGoToLastPage () 
     141{ 
     142    return m_SensitiveGoToLastPage; 
     143} 
     144 
     145gboolean 
     146DumbMainView::isSensitiveGoToNextPage () 
     147{ 
     148    return m_SensitiveGoToNextPage; 
     149} 
     150 
     151gboolean 
     152DumbMainView::isSensitiveGoToPage () 
     153{ 
     154    return m_SensitiveGoToPage; 
     155} 
     156 
     157gboolean 
     158DumbMainView::isSensitiveGoToPreviousPage () 
     159{ 
     160    return m_SensitiveGoToPreviousPage; 
     161} 
     162 
     163gboolean 
     164DumbMainView::isSensitiveZoomIn () 
     165{ 
     166    return m_SensitiveZoomIn; 
     167} 
     168 
     169gboolean 
     170DumbMainView::isSensitiveZoomOut () 
     171{ 
     172    return m_SensitiveZoomOut; 
     173} 
     174 
     175gboolean 
     176DumbMainView::isSensitiveZoomFit () 
     177{ 
     178    return m_SensitiveZoomFit; 
     179} 
     180 
     181gboolean 
     182DumbMainView::isSensitiveZoomWidth () 
     183{ 
     184    return m_SensitiveZoomWidth; 
     185} 
     186 
     187gboolean 
     188DumbMainView::hasImagePageView () 
     189{ 
     190    return NULL != m_DocumentPage; 
     191}