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

List:       koffice-devel
Subject:    Re: Review Request: Support for hyperlinks in kpresenter presentation
From:       "Matus Hanzes" <matus.hanzes () ixonos ! com>
Date:       2010-10-21 6:44:05
Message-ID: 20101021064405.27767.473 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 2010-10-16 14:48:49, Thomas Zander wrote:
> > trunk/koffice/plugins/textshape/TextEventAction.cpp, line 87
> > <http://svn.reviewboard.kde.org/r/5633/diff/1/?file=39328#file39328line87>
> > 
> > does this work when you have more than one shape?
> 
> Matus Hanzes wrote:
> When more text shapes are on one slide in kpresenter, the code works. If you see \
> some problems please tell me. 
> Thomas Zander wrote:
> I meant more than one text shape for a text-document. Like multiple pages in kword.
> This concept is possible in any KOffice application, and I think the above code \
> will only work for the first shape in a series. 
> Matus Hanzes wrote:
> No the idea behind this is that every text shape has his own TextEventAction. If \
> the mouse pointer is over different shape even if the shape has the same \
> text-document as the TextEventAction parent text shape, the TextEventAction will do \
> nothing. 
> The program has to ask TextShape over which the mouse pointer is hovering for the \
> TextEventAction. 
> 
> In kword if more TextShapes have the same text-document and one of the shapes is \
> selected. The mouse pointer will change from IBeamCursor to PointingHandCursor only \
> in the selected shape.  
> 
> 
> Thomas Zander wrote:
> I'm aware that every shape has its own TextEventAction, thats not what I was \
> talking about. The calcucation I commented on will not work for the second shape \
> (or later) in a series because you don't take into account the offset in the \
> QTextDocument you are using. 
> But since you brought up the issue; you wrote only the selected shape is used.  Are \
> you saying that if the user has a blue underlined url in one shape that is on the \
> master page (and thus can't be selected) and another blue underlined url in the \
> currently active shape you can only click on the last one? How does that make \
> sense? 
> Your point that every shape has its own TextEventAction made me worry about about \
> the overhead; loading a new document will suddenly have an extra malloc for each \
> shape. Which is some 3 per page in kword.

It will work for the second page, because I am using TextShape::ConvertScreenPosition \
where the QTextDocument offset is taken into account.

It is not a problem when something is not selectable.
I just wanted to say that not even kword with the use of TextTool is supporting the \
feature you have described.

You are right with the overhead, I will move the malloc from constructor to \
eventActions() function. Then there would be no overhead in kword.


- Matus


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5633/#review8184
-----------------------------------------------------------


On 2010-10-15 14:40:48, Matus Hanzes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5633/
> -----------------------------------------------------------
> 
> (Updated 2010-10-15 14:40:48)
> 
> 
> Review request for KOffice, Thorsten Zachmann and Thomas Zander.
> 
> 
> Summary
> -------
> 
> Support for hyperlinks in presentation mode consist of two problems
> 1.	Change the cursor from ArrowCursor to PointingHandCursur, when the cursor is \
> over the hyperlink. 2.	Run the hyperlink, when the hyperlink is clicked.
> 
> I have used KoShape EventAction framework for accessing the data inside TextShape.
> To work with hyperlinks in TextEvenAction I have used code from TextTool.
> 
> I will do unit tests after this solution is approved.
> 
> 
> Diffs
> -----
> 
> trunk/koffice/kpresenter/part/KPrPresentationTool.cpp 1186176 
> trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.h 1186176 
> trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.cpp 1186176 \
>  trunk/koffice/libs/flake/KoEventAction.h 1186176 
> trunk/koffice/plugins/textshape/CMakeLists.txt 1186176 
> trunk/koffice/plugins/textshape/TextEventAction.h PRE-CREATION 
> trunk/koffice/plugins/textshape/TextEventAction.cpp PRE-CREATION 
> trunk/koffice/plugins/textshape/TextShape.h 1186176 
> trunk/koffice/plugins/textshape/TextShape.cpp 1186176 
> trunk/koffice/plugins/textshape/tests/CMakeLists.txt 1186176 
> trunk/koffice/plugins/videoshape/VideoEventAction.h 1186176 
> trunk/koffice/plugins/videoshape/VideoEventAction.cpp 1186176 
> 
> Diff: http://svn.reviewboard.kde.org/r/5633/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matus
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/5633/">http://svn.reviewboard.kde.org/r/5633/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 16th, 2010, 2:48 p.m., <b>Thomas \
Zander</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://svn.reviewboard.kde.org/r/5633/diff/1/?file=39328#file39328line87" \
style="color: black; font-weight: bold; text-decoration: \
underline;">trunk/koffice/plugins/textshape/TextEventAction.cpp</a>  <span \
style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">bool TextEventAction::getHyperlink(const QPointF &amp;position, QString \
&amp;href)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">87</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="kt">int</span> <span class="n">caretPos</span> <span class="o">=</span> <span \
class="n">m_textShape</span><span class="o">-&gt;</span><span \
class="n">textShapeData</span><span class="p">()</span><span \
class="o">-&gt;</span><span class="n">document</span><span class="p">()</span><span \
class="o">-&gt;</span><span class="n">documentLayout</span><span \
class="p">()</span><span class="o">-&gt;</span><span class="n">hitTest</span><span \
class="p">(</span><span class="n">p</span><span class="p">,</span> <span \
class="n">Qt</span><span class="o">::</span><span class="n">FuzzyHit</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">does this work when you \
have more than one shape?</pre>  </blockquote>



 <p>On October 18th, 2010, 12:26 p.m., <b>Matus Hanzes</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">When more text shapes \
are on one slide in kpresenter, the code works. If you see some problems please tell \
me.</pre>  </blockquote>





 <p>On October 19th, 2010, 11:43 a.m., <b>Thomas Zander</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I meant more than one \
text shape for a text-document. Like multiple pages in kword. This concept is \
possible in any KOffice application, and I think the above code will only work for \
the first shape in a series.</pre>  </blockquote>





 <p>On October 20th, 2010, 2:47 p.m., <b>Matus Hanzes</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">No the idea behind this \
is that every text shape has his own TextEventAction. If the mouse pointer is over \
different shape even if the shape has the same text-document as the TextEventAction \
parent text shape, the TextEventAction will do nothing.

The program has to ask TextShape over which the mouse pointer is hovering for the \
TextEventAction.


In kword if more TextShapes have the same text-document and one of the shapes is \
selected. The mouse pointer will change from IBeamCursor to PointingHandCursor only \
in the selected shape. 

</pre>
 </blockquote>





 <p>On October 20th, 2010, 3:38 p.m., <b>Thomas Zander</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;m aware that every \
shape has its own TextEventAction, thats not what I was talking about. The \
calcucation I commented on will not work for the second shape (or later) in a series \
because you don&#39;t take into account the offset in the QTextDocument you are \
using.

But since you brought up the issue; you wrote only the selected shape is used.  Are \
you saying that if the user has a blue underlined url in one shape that is on the \
master page (and thus can&#39;t be selected) and another blue underlined url in the \
currently active shape you can only click on the last one? How does that make sense?

Your point that every shape has its own TextEventAction made me worry about about the \
overhead; loading a new document will suddenly have an extra malloc for each shape. \
Which is some 3 per page in kword.</pre>  </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It will \
work for the second page, because I am using TextShape::ConvertScreenPosition where \
the QTextDocument offset is taken into account.

It is not a problem when something is not selectable.
I just wanted to say that not even kword with the use of TextTool is supporting the \
feature you have described.

You are right with the overhead, I will move the malloc from constructor to \
eventActions() function. Then there would be no overhead in kword.</pre>
<br />




<p>- Matus</p>


<br />
<p>On October 15th, 2010, 2:40 p.m., Matus Hanzes wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KOffice, Thorsten Zachmann and Thomas Zander.</div>
<div>By Matus Hanzes.</div>


<p style="color: grey;"><i>Updated 2010-10-15 14:40:48</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Support for hyperlinks in presentation mode consist of two problems \
1.	Change the cursor from ArrowCursor to PointingHandCursur, when the cursor is over \
the hyperlink. 2.	Run the hyperlink, when the hyperlink is clicked.

I have used KoShape EventAction framework for accessing the data inside TextShape.
To work with hyperlinks in TextEvenAction I have used code from TextTool.

I will do unit tests after this solution is approved.</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>trunk/koffice/kpresenter/part/KPrPresentationTool.cpp <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.h <span \
style="color: grey">(1186176)</span></li>

 <li>trunk/koffice/kpresenter/plugins/eventactions/sound/KPrSoundEventAction.cpp \
<span style="color: grey">(1186176)</span></li>

 <li>trunk/koffice/libs/flake/KoEventAction.h <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/plugins/textshape/CMakeLists.txt <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/plugins/textshape/TextEventAction.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/textshape/TextEventAction.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/koffice/plugins/textshape/TextShape.h <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/plugins/textshape/TextShape.cpp <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/plugins/textshape/tests/CMakeLists.txt <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/plugins/videoshape/VideoEventAction.h <span style="color: \
grey">(1186176)</span></li>

 <li>trunk/koffice/plugins/videoshape/VideoEventAction.cpp <span style="color: \
grey">(1186176)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/5633/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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