1 /* AbiWord
2  * Copyright (C) 2011 AbiSource, Inc.
3  * Copyright (C) 2011 Ben Martin
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301 USA.
19  */
20 
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include "ap_Features.h"
26 
27 #include "ut_assert.h"
28 #include "ut_string.h"
29 #include "ut_std_string.h"
30 #include "ut_debugmsg.h"
31 #include "ap_Dialog_Modal.h"
32 #include "ap_Strings.h"
33 
34 #include "xap_App.h"
35 #include "xap_Dialog_Id.h"
36 #include "xap_DialogFactory.h"
37 #include "xap_Dlg_MessageBox.h"
38 
39 #include "fl_DocLayout.h"
40 #include "fv_View.h"
41 #include "fl_BlockLayout.h"
42 #include "xap_Frame.h"
43 #include "pd_Document.h"
44 
45 
46 
AP_Dialog_Modal(XAP_DialogFactory * pDlgFactory,XAP_Dialog_Id id,const char * helpUrl)47 AP_Dialog_Modal::AP_Dialog_Modal( XAP_DialogFactory * pDlgFactory,
48                                   XAP_Dialog_Id id,
49                                   const char * helpUrl )
50 	: XAP_Dialog_NonPersistent( pDlgFactory, id, helpUrl )
51 {
52 }
53 
~AP_Dialog_Modal()54 AP_Dialog_Modal::~AP_Dialog_Modal()
55 {
56 }
57 
58 
59 void
maybeClosePopupPreviewBubbles()60 AP_Dialog_Modal::maybeClosePopupPreviewBubbles()
61 {
62     closePopupPreviewBubbles();
63 }
64 
65 FV_View*
getView() const66 AP_Dialog_Modal::getView() const
67 {
68     XAP_Frame * pFrame = m_pApp->getLastFocussedFrame();
69 	if(pFrame == (XAP_Frame *) NULL)
70 	{
71 		pFrame = m_pApp->getFrame(0);
72 	}
73 
74     if( !pFrame )
75         return 0;
76 
77     FV_View* pView = (FV_View *)pFrame->getCurrentView();
78     return pView;
79 }
80 
81 
82 void
closePopupPreviewBubbles()83 AP_Dialog_Modal::closePopupPreviewBubbles()
84 {
85   	FV_View* view = getView();
86     m_bubbleBlocker = view->getBubbleBlocker();
87 }
88 
89 void
maybeReallowPopupPreviewBubbles()90 AP_Dialog_Modal::maybeReallowPopupPreviewBubbles()
91 {
92     m_bubbleBlocker = FV_View_BubbleBlocker();
93     UT_DEBUGMSG(("AP_Dialog_Modal::maybeReallowPopupPreviewBubbles()\n"));
94 }
95 
96